摘要:
1 CREATE proc spGenInsertSQL (@tablename varchar(256)) 2 as 3 begin 4 declare @sql varchar(8000) 5 declare @sqlValues varchar(8000) 6 set @sql =' (' 7 set @sqlValues = 'values (''+' 8 select @sqlValues = @sqlValues + cols + ' + '','' + ' ,@sql = @sql + 阅读全文
摘要:
摘自:http://blog.csdn.net/keenweiwei/article/details/6859490 1 SELECT 2 C.name as [字段名],T.name as [字段类型] 3 ,convert(bit,C.IsNullable) as [可否为空] 4 ,convert(bit,case when exists(SELECT 1 FROM sysobjects where xtype='PK' and parent_obj=c.id and name in ( 5 SELECT name FROM sysind... 阅读全文
摘要:
SELECT 表名 = case when a.colorder=1 then d.name else '' end, 表说明 = case when a.colorder=1 then isnull(f.value,'') else '' end, -- 字段序号 = a.colorder, 字段名 = a.name, 标识 = case when COLUMNPROPERTY( a.id,a.name,'IsIdentity')=1 then '√'else '' end, 主键 = case 阅读全文