问一问题,得到答案马上结贴
wofan 2004-09-29 10:38:04 数据库里有一表StockData
我要检测它是否存在,如果不存在则创建它
CREATE TABLE [StockData] (
[序号] [int] IDENTITY (1, 1) NOT NULL ,
[仓库] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[日期] [datetime] NULL ,
[配件代码] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[实际库存] [decimal](18, 0) NULL ,
[帐面库存] [decimal](18, 0) NULL ,
[入库数量] [decimal](18, 0) NULL ,
[入库金额] [decimal](18, 0) NULL ,
[出库数量] [decimal](18, 0) NULL ,
[出库成本金额] [decimal](18, 0) NULL ,
[出库销售金额] [decimal](18, 0) NULL ,
[采购入库数量] [decimal](18, 0) NULL ,
[采购入库金额] [decimal](18, 0) NULL ,
[调拨入库数量] [decimal](18, 0) NULL ,
[调拨入库金额] [decimal](18, 0) NULL ,
[移库入库数量] [decimal](18, 0) NULL ,
[移库入库金额] [decimal](18, 0) NULL ,
[其它入库数量] [decimal](18, 0) NULL ,
[其它入库金额] [decimal](18, 0) NULL ,
[报溢入库数量] [decimal](18, 0) NULL ,
[报溢入库金额] [decimal](18, 0) NULL ,
[借出归还数量] [decimal](18, 0) NULL ,
[借出归还金额] [decimal](18, 0) NULL ,
[借进数量] [decimal](18, 0) NULL ,
[借进金额] [decimal](18, 0) NULL ,
[维修领料数量] [decimal](18, 0) NULL ,
[维修领料成本金额] [decimal](18, 0) NULL ,
[维修领料销售金额] [decimal](18, 0) NULL ,
[配件销售数量] [decimal](18, 0) NULL ,
[配件销售成本金额] [decimal](18, 0) NULL ,
[配件销售销售金额] [decimal](18, 0) NULL ,
[内部领用数量] [decimal](18, 0) NULL ,
[内部领用成本金额] [decimal](18, 0) NULL ,
[内部领用销售金额] [decimal](18, 0) NULL ,
[调拨出库数量] [decimal](18, 0) NULL ,
[调拨出库成本金额] [decimal](18, 0) NULL ,
[调拨出库销售金额] [decimal](18, 0) NULL ,
[移库出库数量] [decimal](18, 0) NULL ,
[移库出库成本金额] [decimal](18, 0) NULL ,
[移库出库销售金额] [decimal](18, 0) NULL ,
[其它出库数量] [decimal](18, 0) NULL ,
[其它出库成本金额] [decimal](18, 0) NULL ,
[其它出库销售金额] [decimal](18, 0) NULL ,
[报损出库数量] [decimal](18, 0) NULL ,
[报损出库成本金额] [decimal](18, 0) NULL ,
[报损出库销售金额] [decimal](18, 0) NULL ,
[车间借料数量] [decimal](18, 0) NULL ,
[车间借料成本金额] [decimal](18, 0) NULL ,
[车间借料销售金额] [decimal](18, 0) NULL ,
[借出数量] [decimal](18, 0) NULL ,
[借出成本金额] [decimal](18, 0) NULL ,
[借出销售金额] [decimal](18, 0) NULL ,
[借进归还数量] [decimal](18, 0) NULL ,
[借进归还成本金额] [decimal](18, 0) NULL ,
[借进归还销售金额] [decimal](18, 0) NULL ,
CONSTRAINT [PK_StockDate] PRIMARY KEY CLUSTERED
(
[序号]
) ON [PRIMARY]
) ON [PRIMARY]
GO
该如何写检测部分