赞
踩
- /****** 1、表存在则删除 ******/
- IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[AAAAA_____________2309]') AND type in (N'U'))
- DROP TABLE [dbo].[AAAAA_____________2309]
- /*Tips:可数据库任意表右键》》编写表脚本为》》DROP到》》新查询编辑器窗口 得到如上代码段*/
- GO
-
-
- /****** 2、创建表:字段、类型、长度、标识 ******/
- CREATE TABLE [dbo].[AAAAA_____________2309](
- [ID] [int] IDENTITY(1,3) NOT NULL,/*标识种子,标识增量*/
- [CREATE_DATE] [datetime] NULL,
- [A001] [varchar](4) NULL,
- [A002] [char](1) NULL,
- [A003] [int] NULL,
- [A004] [float] NULL,
- ) ON [PRIMARY]
- GO
-
-
- /****** 3、添加默认值 ******/
- ALTER TABLE [dbo].[AAAAA_____________2309] ADD DEFAULT (getdate()) FOR [CREATE_DATE]
- GO
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。