摘要: 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 阅读全文
posted @ 2019-07-15 13:27 AndSir 阅读(645) 评论(0) 推荐(0) 编辑
摘要: --设置主键 --alter table 你的表名 add constraint pk_s primary key (id) SELECT 'alter table ' + TABLE_NAME + ' add constraint PK_'+TABLE_NAME +'_'+ COLUMN_NAME 阅读全文
posted @ 2019-07-15 13:25 AndSir 阅读(839) 评论(0) 推荐(0) 编辑
摘要: --修改字段为首字母大写 -- EXEC sp_rename 'ShenBao_CaiGouFuKuan.Tid', 'Tid', @objtype = 'COLUMN'; SELECT 'EXEC sp_rename ''' + TABLE_NAME + '.' + COLUMN_NAME + ' 阅读全文
posted @ 2019-07-15 13:23 AndSir 阅读(1787) 评论(0) 推荐(0) 编辑
http://www.andsir.cn