查看数据库所有表的所有字段
2015-09-15 08:55 只喝牛奶的杀手 阅读(408) 评论(0) 编辑 收藏 举报select sysobjects.name as tbName,
syscolumns.name as colName,(case when (CHARINDEX('char', type_name(syscolumns.xtype))>0) then '('+type_name(syscolumns.xtype)+'('+str(length,3)+')'+','+(case syscolumns.isnullable when 0 then 'not null' else 'null' end) +')' else '('+type_name(syscolumns.xtype)+','+(case syscolumns.isnullable when 0 then 'not null' else 'null' end) +')' end) as colType from sysobjects left join syscolumns on syscolumns.id=object_id(sysobjects.name) where sysobjects.xtype='U' order by sysobjects.name
欢迎大家关注微信号killerhub,微信公众号名称:只喝牛奶的杀手, 扫下面的二维码或者收藏下面的二维码关注吧(长按下面的二维码图片、并选择识别图中的二维码)