打印本文 打印本文 关闭窗口 关闭窗口
收藏几段SQL语句和存储过程
作者:武汉SEO闵涛  文章来源:敏韬网  点击数4804  更新时间:2007/11/14 10:58:59  文章录入:mintao  责任编辑:mintao
              (xtype = ''''PK''''))>0 then '''''''' else '''''''' end) 主键,

       b.name 类型,

       a.length 占用字节数,

       COLUMNPROPERTY(a.id,a.name,''''PRECISION'''') as 长度,

       isnull(COLUMNPROPERTY(a.id,a.name,''''Scale''''),0) as 小数位数,

       (case when a.isnullable=1 then ''''''''else '''''''' end) 允许空,

       isnull(e.text,'''''''') 默认值,

       isnull(g.[value],'''''''') AS 字段说明   

 

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 

order by a.id,a.colorder

-------------------------------------------------------------------------------------------------

 

 

 

 

 

 

列出SQL SERVER 所有表、字段定义,类型,长度,一个值等信息

并导出到Excel

-- ======================================================

-- Export all user tables definition and one sample value

-- jan-13-2003,Dr.Zhang

-- ======================================================

在查询分析器里运行:

SET ANSI_NU

上一页  [1] [2] [3] [4] [5] [6] [7] [8]  下一页

打印本文 打印本文 关闭窗口 关闭窗口