摘要:
Declare @Pk varChar(100);Declare @TBname varChar(100);declare cursor1 cursor for Select Sys2.name as TBname,Sys1.name as Pk from sysobjects Sys1 JOIN 阅读全文
摘要:
--设置主键 --alter table 你的表名 add constraint pk_s primary key (id) SELECT 'alter table ' + TABLE_NAME + ' add constraint PK_'+TABLE_NAME +'_'+ COLUMN_NAME 阅读全文
摘要:
--修改字段为首字母大写 -- EXEC sp_rename 'ShenBao_CaiGouFuKuan.Tid', 'Tid', @objtype = 'COLUMN'; SELECT 'EXEC sp_rename ''' + TABLE_NAME + '.' + COLUMN_NAME + ' 阅读全文