All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
php+xapian,extension的安装_php资料_编程技术
C#中添加XML节点实例
用C#和ADO.NET建立一个数据绑定网格_.net资料_编程技术
.NET内置对象之Response对象_[Asp.Net教程]
ASP.NET中url传递中文的解决方案_[Asp.Net教程]
如何将应用程序由ASP.NET,1.1移植到ASP.NET,2.0_[Asp.Net教程]
SQL Server数据库中bit字段类型使用时的注意事项
Asp.net中创建和使用Ado.net_[Asp.Net教程]
[delphi语法1]Object Pascal语言编写环境
SQL2005中的事务与锁定(七)_mssql学习_编程技术
Reading number is top 10 pictures
Other people's teacher VS my teacher
Magnificent cloud1
Take you to walk into the most true north Korea rural1
美洲杯宝贝的雨中风情1
Steal to eat bacon bird
The beginning and end
奇趣的世界记录3
Catch prostitution woman in China
Go to the national museum3
男人,就要活出棱角
Download software ranking
尖东毒玫瑰A
Boxer vs Yellow1
功夫熊猫2(上集)
Ashlynn Video4
Proficient in Eclipse
C#程序员参考手册
虚拟机5.5.3版
星际争霸1.08硬盘免安装版
Professional killers2 for Android
小黑猫大战两米大花蛇
归海一刀 published in(发表于) 2014/2/1 0:17:50 Edit(编辑)
一条语句查询数据库中所以表的信息_[SQL,Server教程]

一条语句查询数据库中所以表的信息_[SQL,Server教程]

一条语句查询数据库中所以表的信息_[SQL Server教程]

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 when exists(SELECT 1 FROM sysobjects where xtype='PK' and name in (SELECT name FROM sysindexes WHERE indid in(SELECT indid FROM sysindexkeys WHERE id = a.id AND colid=a.colid))) then '√' else '' end,
类型=b.name,
占用字节数=a.length,
长度=COLUMNPROPERTY(a.id,a.name,'PRECISION'),
小数位数=isnull(COLUMNPROPERTY(a.id,a.name,'Scale'),0),
允许空=case when a.isnullable=1 then '√'else '' end,
默认值=isnull(e.text,''),
字段说明=isnull(g.[value],'')
FROM syscolumns a
left join systypes b on a.xtype=b.xusertype
inner join sysobjects d on a.id=d.id and d.xtype='U' and d.name<>'dtproperties'
left join syscomments e on a.cdefault=e.id
left join sysproperties g on a.id=g.id and a.colid=g.smallid
left join sysproperties f on d.id=f.id and f.smallid=0
--where d.name='此处可添加要查询的表名'
Order by a.id,a.colorder

可以在where语句中填写要查询指定表的名称,将显示指定的结构信息和说明







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.