标签:-- null parent bsp cts 添加 constrain 语句 select
--查询表主键 EXEC sp_pkeys @table_name=‘Plat_CommAttrSelect‘ --删除表主键 Declare @Pk varChar(100); Select @Pk=Name from sysobjects where Parent_Obj=OBJECT_ID(‘Plat_CommAttrSelect‘) and xtype=‘PK‘; if @Pk is not null exec(‘Alter table Plat_CommAttrSelect Drop ‘+ @Pk) --添加表主键 alter table Plat_CommAttrSelect add constraint Plat_CommAttrSelect_PK primary key(ID)
标签:-- null parent bsp cts 添加 constrain 语句 select
原文地址:http://www.cnblogs.com/onesmail/p/6121094.html