代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
MSSQL
】
取得数据库表信息的Sql语句
作者:
Dezai.CN
/ 发布于
2011/8/1
/
740
<div> <div><span style="color: rgb(0,0,0)">Sql2000: </span><span style="color: rgb(0,0,255)">SELECT</span><span style="color: rgb(0,0,0)"> d.name N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">表名</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">,a.colorder</span><span style="color: rgb(128,128,128)">-</span><span style="color: rgb(128,0,0); font-weight: bold">1</span><span style="color: rgb(0,0,0)"> N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">字段序号</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">,a.name N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">字段名</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, (</span><span style="color: rgb(255,0,255)">case</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">when</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,255)">COLUMNPROPERTY</span><span style="color: rgb(0,0,0)">( a.id,a.name,</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">IsIdentity</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">)</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(128,0,0); font-weight: bold">1</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">then</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">Y</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,255)">else</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">''</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">end</span><span style="color: rgb(0,0,0)">) N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">标识</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, (</span><span style="color: rgb(255,0,255)">case</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">when</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,255)">SELECT</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,255)">count</span><span style="color: rgb(0,0,0)">(</span><span style="color: rgb(128,128,128)">*</span><span style="color: rgb(0,0,0)">) </span><span style="color: rgb(0,0,255)">FROM</span><span style="color: rgb(0,0,0)"> sysobjects </span><span style="color: rgb(0,0,255)">WHERE</span><span style="color: rgb(0,0,0)"> (name </span><span style="color: rgb(128,128,128)">in</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,255)">SELECT</span><span style="color: rgb(0,0,0)"> name </span><span style="color: rgb(0,0,255)">FROM</span><span style="color: rgb(0,0,0)"> sysindexes </span><span style="color: rgb(0,0,255)">WHERE</span><span style="color: rgb(0,0,0)"> (id </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> a.id) </span><span style="color: rgb(128,128,128)">AND</span><span style="color: rgb(0,0,0)"> (indid </span><span style="color: rgb(128,128,128)">in</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,255)">SELECT</span><span style="color: rgb(0,0,0)"> indid </span><span style="color: rgb(0,0,255)">FROM</span><span style="color: rgb(0,0,0)"> sysindexkeys </span><span style="color: rgb(0,0,255)">WHERE</span><span style="color: rgb(0,0,0)"> (id </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> a.id) </span><span style="color: rgb(128,128,128)">AND</span><span style="color: rgb(0,0,0)"> (colid </span><span style="color: rgb(128,128,128)">in</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,255)">SELECT</span><span style="color: rgb(0,0,0)"> colid </span><span style="color: rgb(0,0,255)">FROM</span><span style="color: rgb(0,0,0)"> syscolumns </span><span style="color: rgb(0,0,255)">WHERE</span><span style="color: rgb(0,0,0)"> (id </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> a.id) </span><span style="color: rgb(128,128,128)">AND</span><span style="color: rgb(0,0,0)"> (name </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> a.name))))))) </span><span style="color: rgb(128,128,128)">AND</span><span style="color: rgb(0,0,0)"> (xtype </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">PK</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">))</span><span style="color: rgb(128,128,128)">></span><span style="color: rgb(128,0,0); font-weight: bold">0</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">then</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">Y</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">else</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">''</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">end</span><span style="color: rgb(0,0,0)">) N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">主键</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, b.name N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">类型</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, a.length N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">占用字节数</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, </span><span style="color: rgb(255,0,255)">COLUMNPROPERTY</span><span style="color: rgb(0,0,0)">(a.id,a.name,</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">PRECISION</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">) </span><span style="color: rgb(0,0,255)">as</span><span style="color: rgb(0,0,0)"> N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">长度</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, </span><span style="color: rgb(255,0,255)">isnull</span><span style="color: rgb(0,0,0)">(</span><span style="color: rgb(255,0,255)">COLUMNPROPERTY</span><span style="color: rgb(0,0,0)">(a.id,a.name,</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">Scale</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">),</span><span style="color: rgb(128,0,0); font-weight: bold">0</span><span style="color: rgb(0,0,0)">) </span><span style="color: rgb(0,0,255)">as</span><span style="color: rgb(0,0,0)"> N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">小数位数</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, (</span><span style="color: rgb(255,0,255)">case</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">when</span><span style="color: rgb(0,0,0)"> a.isnullable</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(128,0,0); font-weight: bold">1</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">then</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">Y</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,255)">else</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">''</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">end</span><span style="color: rgb(0,0,0)">) N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">允许空</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, </span><span style="color: rgb(255,0,255)">isnull</span><span style="color: rgb(0,0,0)">(e.</span><span style="color: rgb(0,0,255)">text</span><span style="color: rgb(0,0,0)">,</span><span style="color: rgb(255,0,0)">''</span><span style="color: rgb(0,0,0)">) N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">默认值</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, </span><span style="color: rgb(255,0,255)">convert</span><span style="color: rgb(0,0,0)">(</span><span style="color: rgb(0,0,255)">varchar</span><span style="color: rgb(0,0,0)">(</span><span style="color: rgb(128,0,0); font-weight: bold">50</span><span style="color: rgb(0,0,0)">), </span><span style="color: rgb(255,0,255)">isnull</span><span style="color: rgb(0,0,0)">(g.</span><span style="color: rgb(255,0,0)">[</span><span style="color: rgb(255,0,0)">value</span><span style="color: rgb(255,0,0)">]</span><span style="color: rgb(0,0,0)">,</span><span style="color: rgb(255,0,0)">''</span><span style="color: rgb(0,0,0)">)) </span><span style="color: rgb(0,0,255)">AS</span><span style="color: rgb(0,0,0)"> N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">字段说明</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">FROM</span><span style="color: rgb(0,0,0)"> syscolumns a </span><span style="color: rgb(128,128,128)">left</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">join</span><span style="color: rgb(0,0,0)"> systypes b </span><span style="color: rgb(0,0,255)">on</span><span style="color: rgb(0,0,0)"> a.xtype</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">b.xusertype </span><span style="color: rgb(0,0,255)">inner</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">join</span><span style="color: rgb(0,0,0)"> sysobjects d </span><span style="color: rgb(0,0,255)">on</span><span style="color: rgb(0,0,0)"> a.id</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">d.id </span><span style="color: rgb(128,128,128)">and</span><span style="color: rgb(0,0,0)"> d.xtype</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">U</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">and</span><span style="color: rgb(0,0,0)"> d.name</span><span style="color: rgb(128,128,128)"><></span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">dtproperties</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">left</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">join</span><span style="color: rgb(0,0,0)"> syscomments e </span><span style="color: rgb(0,0,255)">on</span><span style="color: rgb(0,0,0)"> a.cdefault</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">e.id </span><span style="color: rgb(128,128,128)">left</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">join</span><span style="color: rgb(0,0,0)"> sysproperties g </span><span style="color: rgb(0,0,255)">on</span><span style="color: rgb(0,0,0)"> a.id</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">g.id </span><span style="color: rgb(128,128,128)">AND</span><span style="color: rgb(0,0,0)"> a.colid </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> g.smallid </span><span style="color: rgb(0,0,255)">order</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">by</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,255)">object_name</span><span style="color: rgb(0,0,0)">(a.id),a.colorder SQL2005: </span><span style="color: rgb(0,0,255)">SELECT</span><span style="color: rgb(0,0,0)"> d.name N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">表名</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">,a.colorder</span><span style="color: rgb(128,128,128)">-</span><span style="color: rgb(128,0,0); font-weight: bold">1</span><span style="color: rgb(0,0,0)"> N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">字段序号</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">,a.name N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">字段名</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, (</span><span style="color: rgb(255,0,255)">case</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">when</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,255)">COLUMNPROPERTY</span><span style="color: rgb(0,0,0)">( a.id,a.name,</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">IsIdentity</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">)</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(128,0,0); font-weight: bold">1</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">then</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">Y</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,255)">else</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">''</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">end</span><span style="color: rgb(0,0,0)">) N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">标识</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, (</span><span style="color: rgb(255,0,255)">case</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">when</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,255)">SELECT</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,255)">count</span><span style="color: rgb(0,0,0)">(</span><span style="color: rgb(128,128,128)">*</span><span style="color: rgb(0,0,0)">) </span><span style="color: rgb(0,0,255)">FROM</span><span style="color: rgb(0,0,0)"> sysobjects </span><span style="color: rgb(0,0,255)">WHERE</span><span style="color: rgb(0,0,0)"> (name </span><span style="color: rgb(128,128,128)">in</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,255)">SELECT</span><span style="color: rgb(0,0,0)"> name </span><span style="color: rgb(0,0,255)">FROM</span><span style="color: rgb(0,0,0)"> sysindexes </span><span style="color: rgb(0,0,255)">WHERE</span><span style="color: rgb(0,0,0)"> (id </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> a.id) </span><span style="color: rgb(128,128,128)">AND</span><span style="color: rgb(0,0,0)"> (indid </span><span style="color: rgb(128,128,128)">in</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,255)">SELECT</span><span style="color: rgb(0,0,0)"> indid </span><span style="color: rgb(0,0,255)">FROM</span><span style="color: rgb(0,0,0)"> sysindexkeys </span><span style="color: rgb(0,0,255)">WHERE</span><span style="color: rgb(0,0,0)"> (id </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> a.id) </span><span style="color: rgb(128,128,128)">AND</span><span style="color: rgb(0,0,0)"> (colid </span><span style="color: rgb(128,128,128)">in</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,255)">SELECT</span><span style="color: rgb(0,0,0)"> colid </span><span style="color: rgb(0,0,255)">FROM</span><span style="color: rgb(0,0,0)"> syscolumns </span><span style="color: rgb(0,0,255)">WHERE</span><span style="color: rgb(0,0,0)"> (id </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> a.id) </span><span style="color: rgb(128,128,128)">AND</span><span style="color: rgb(0,0,0)"> (name </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> a.name))))))) </span><span style="color: rgb(128,128,128)">AND</span><span style="color: rgb(0,0,0)"> (xtype </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">PK</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">))</span><span style="color: rgb(128,128,128)">></span><span style="color: rgb(128,0,0); font-weight: bold">0</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">then</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">Y</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">else</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">''</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">end</span><span style="color: rgb(0,0,0)">) N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">主键</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, b.name N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">类型</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, a.length N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">占用字节数</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, </span><span style="color: rgb(255,0,255)">COLUMNPROPERTY</span><span style="color: rgb(0,0,0)">(a.id,a.name,</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">PRECISION</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">) </span><span style="color: rgb(0,0,255)">as</span><span style="color: rgb(0,0,0)"> N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">长度</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, </span><span style="color: rgb(255,0,255)">isnull</span><span style="color: rgb(0,0,0)">(</span><span style="color: rgb(255,0,255)">COLUMNPROPERTY</span><span style="color: rgb(0,0,0)">(a.id,a.name,</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">Scale</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">),</span><span style="color: rgb(128,0,0); font-weight: bold">0</span><span style="color: rgb(0,0,0)">) </span><span style="color: rgb(0,0,255)">as</span><span style="color: rgb(0,0,0)"> N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">小数位数</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, (</span><span style="color: rgb(255,0,255)">case</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">when</span><span style="color: rgb(0,0,0)"> a.isnullable</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(128,0,0); font-weight: bold">1</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">then</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">Y</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,255)">else</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,0)">''</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">end</span><span style="color: rgb(0,0,0)">) N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">允许空</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, </span><span style="color: rgb(255,0,255)">isnull</span><span style="color: rgb(0,0,0)">(e.</span><span style="color: rgb(0,0,255)">text</span><span style="color: rgb(0,0,0)">,</span><span style="color: rgb(255,0,0)">''</span><span style="color: rgb(0,0,0)">) N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">默认值</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)">, </span><span style="color: rgb(255,0,255)">convert</span><span style="color: rgb(0,0,0)">(</span><span style="color: rgb(0,0,255)">varchar</span><span style="color: rgb(0,0,0)">(</span><span style="color: rgb(128,0,0); font-weight: bold">50</span><span style="color: rgb(0,0,0)">), </span><span style="color: rgb(255,0,255)">isnull</span><span style="color: rgb(0,0,0)">(g.</span><span style="color: rgb(255,0,0)">[</span><span style="color: rgb(255,0,0)">value</span><span style="color: rgb(255,0,0)">]</span><span style="color: rgb(0,0,0)">,</span><span style="color: rgb(255,0,0)">''</span><span style="color: rgb(0,0,0)">)) </span><span style="color: rgb(0,0,255)">AS</span><span style="color: rgb(0,0,0)"> N</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">字段说明</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">FROM</span><span style="color: rgb(0,0,0)"> syscolumns a </span><span style="color: rgb(128,128,128)">left</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">join</span><span style="color: rgb(0,0,0)"> systypes b </span><span style="color: rgb(0,0,255)">on</span><span style="color: rgb(0,0,0)"> a.xtype</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">b.xusertype </span><span style="color: rgb(0,0,255)">inner</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">join</span><span style="color: rgb(0,0,0)"> sysobjects d </span><span style="color: rgb(0,0,255)">on</span><span style="color: rgb(0,0,0)"> a.id</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">d.id </span><span style="color: rgb(128,128,128)">and</span><span style="color: rgb(0,0,0)"> d.xtype</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">U</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">and</span><span style="color: rgb(0,0,0)"> d.name</span><span style="color: rgb(128,128,128)"><></span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(255,0,0)">dtproperties</span><span style="color: rgb(255,0,0)">'</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">left</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">join</span><span style="color: rgb(0,0,0)"> syscomments e </span><span style="color: rgb(0,0,255)">on</span><span style="color: rgb(0,0,0)"> a.cdefault</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">e.id </span><span style="color: rgb(128,128,128)">left</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">join</span><span style="color: rgb(0,0,0)"> sys.extended_properties g </span><span style="color: rgb(0,0,255)">on</span><span style="color: rgb(0,0,0)"> a.id</span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)">g.major_id </span><span style="color: rgb(128,128,128)">AND</span><span style="color: rgb(0,0,0)"> a.colid </span><span style="color: rgb(128,128,128)">=</span><span style="color: rgb(0,0,0)"> g.minor_id </span><span style="color: rgb(0,0,255)">order</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">by</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(255,0,255)">object_name</span><span style="color: rgb(0,0,0)">(a.id),a.colorder</span></div> </div>
试试其它关键字
据库表信息
同语言下
.
SQL查询 多列合并成一行用逗号隔开
.
查看存储过程修改时间,最近执行时间
.
设置手动批量删除数据库相关进程
.
获取某个表中特定字段的所有字符串形式
.
SQL 如何去除重复的字符串
.
怎么去掉一个字段中的重复数据
.
String 去除空格 回车 换行 水平制表符
.
SQL查询和替换含有回车,空格,TAB
.
SQL SERVER 查询每日新增用户数量、次留数量
.
判断两个字符串是否存在相同的内容
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
Dezai.CN
贡献的其它代码
(
4037
)
.
多线程Socket服务器模块
.
生成随机密码
.
清除浮动样式
.
弹出窗口居中
.
抓取url的函数
.
使用base HTTP验证
.
div模拟iframe嵌入效果
.
通过header转向的方法
.
Session操作类
.
执行sqlite输入插入操作后获得自动编号的ID
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3