|M| 邹键老大的一条SQL查询语句有错误,大家看一下要怎么改
SELECT CASE WHEN a.colorder = 1 THEN d.name ELSE ' ' END AS 表名,
CASE WHEN a.colorder = 1 THEN isnull(CONVERT(nvarchar, f.value), ' ')
ELSE ' ' END AS 表说明, a.colorder AS 字段序号, a.name AS 字段名,
CASE WHEN COLUMNPROPERTY(a.id, a.name, 'IsIdentity ')
= 1 THEN '√ ' ELSE ' ' END AS 标识, CASE WHEN EXISTS
(SELECT 1
FROM sysobjects
WHERE xtype = 'PK ' AND name IN
(SELECT name
FROM sysindexes
WHERE indid IN
(SELECT indid
FROM sysindexkeys
WHERE id = a.id AND colid = a.colid)))
THEN '√ ' ELSE ' ' END AS 主键, b.name AS 类型, a.length AS 占用字节数,
COLUMNPROPERTY(a.id, a.name, 'PRECISION ') AS 长度,
ISNULL(COLUMNPROPERTY(a.id, a.name, 'Scale '), 0) AS 小数位数,
CASE WHEN a.isnullable = 1 THEN '√ ' ELSE ' ' END AS 允许空, ISNULL(e.text, ' ')
AS 默认值, ISNULL(CONVERT(nvarchar, g.[value]), ' ') AS 字段说明
FROM syscolumns a LEFT OUTER JOIN
systypes b ON a.xusertype = b.xusertype INNER JOIN
sysobjects d ON a.id = d.id AND &