SQL中查询数据表字段名称的查询语句

SELECT
SysObjects.Name as TableName,
SysColumns.Name as ColumnsName,
SysTypes.Name as DateType,
SysColumns.Length as DateLength,
SysProperties.Value as Remark --列描述
FROM
SysObjects, SysTypes, SysColumns
LEFT JOIN SysProperties ON (Syscolumns.Id = Sysproperties.Id AND Syscolumns.Colid = Sysproperties.Smallid)
WHERE
(Sysobjects.Xtype ='u' OR Sysobjects.Xtype ='v')
AND Sysobjects.Id = Syscolumns.Id
AND SysTypes.XType = Syscolumns.XType
AND SysTypes.Name <> 'sysname'

你可能感兴趣的:(sql)