----选择数据库 use ythome go ----查看表是否存在 if Exists ( select * from sysobjects where name='sys_menu' and type='U' ) ----删除表 begin drop table sys_menu end go create table sys_menu ( ----Primary Key 主键约束 IDENTITY(1,1) 标示列初始值1,标示增量1 [id] int not null Primary…
首先查出字段的默认值约束名称,然后根据默认值约束名称删除默认值约束 ) select @constraintName = b.name from syscolumns a,sysobjects b where a.id=object_id('TB_KYSubProject') and b.id=a.cdefault and a.name='Final_Belong_Programme' and b.name like 'DF%' SELECT @constraintName exec('alte…