查看并导出SQL Server 2000数据表中字段的注释信息:
此示例为导出某个表注释的语句:(表名是bbs_bank_log)
以下为引用的内容: SELECT sysobjects.name AS 表名, syscolumns.name AS 列名, systypes.name AS 数据类型, syscolumns.length AS 数据长度, CONVERT(char, sysproperties.[value]) AS 注释 FROM sysproperties RIGHT OUTER JOIN sysobjects INNER JOIN syscolumns ON sysobjects.id = syscolumns.id INNER JOIN systypes ON syscolumns.xtype = systypes.xtype ON sysproperties.id = syscolumns.id AND sysproperties.smallid = syscolumns.colid WHERE (sysobjects.xtype = 'u' OR sysobjects.xtype = 'v') AND (systypes.name <> 'sysname') --and CONVERT(char,sysproperties.[value]) <> 'null' --导出注释不为'null'的记录 --AND (sysobjects.name = 'bbs_bank_log') --逐个关联表名,可以用or连接条件 ORDER BY 表名 |
注意事项:
上文中的语句是导出某个表的所有注释,如果你需要简单的列出表的所有注释,语句如下:
以下为引用的内容: SELECT CONVERT(char, [value]) AS Expr1 FROM sysproperties |
新闻热点
疑难解答