首页 > 代码库 > Sql获取数据表字段说明
Sql获取数据表字段说明
SELECT Sysobjects.name AS TABLE_NAME , syscolumns.Id , syscolumns.name AS COLUMN_NAME , systypes.name AS DATA_TYPE , syscolumns.length AS CHARACTER_MAXIMUM_LENGTH , sys.extended_properties.[value] AS COLUMN_DESCRIPTION , syscomments.text AS COLUMN_DEFAULT , syscolumns.isnullable AS IS_NULLABLEFROM syscolumns INNER JOIN systypes ON syscolumns.xtype = systypes.xtype LEFT JOIN sysobjects ON syscolumns.id = sysobjects.id LEFT OUTER JOIN sys.extended_properties ON ( sys.extended_properties.minor_id = syscolumns.colid AND sys.extended_properties.major_id = syscolumns.id ) LEFT OUTER JOIN syscomments ON syscolumns.cdefault = syscomments.idWHERE syscolumns.id IN ( SELECT id FROM SYSOBJECTS WHERE xtype = ‘U‘ ) AND ( systypes.name <> ‘sysname‘ ) AND Sysobjects.name=‘OriginalData‘ -- 表名称ORDER BY syscolumns.colid
见图:
Sql获取数据表字段说明
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。