| (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_NULLS OFF GO 上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页 |