日期:2014-05-18 浏览次数:20552 次
--如果存在订货表 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[订货表]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) --删除订货表 drop table [dbo].[订货表] GO --创建订货表 CREATE TABLE [dbo].[订货表] ( [订单编号] [int] IDENTITY (1, 1) NOT NULL , --自增列 [书籍编号] [int] NOT NULL , [数量] [smallint] NOT NULL , [折扣] [real] NOT NULL , [单价] [money] NULL , [销售金额] AS ([单价] * [数量] * [折扣]) --计算列 ) ON [PRIMARY] GO