求解
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER proc [dbo].[test]
(
@tblname char(50)
)
as
SELECT ziduan = a.name,leixing=b.name,
ziduansm = cast(isnull(g.[value], ' ') AS char(50))
FROM syscolumns a LEFT JOIN
systypes b ON a.xusertype = 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 LEFT JOIN
sysproperties f ON d .id = f.id AND f.smallid = 0
WHERE d .name = @tblname
ORDER BY a.id, a.colorder
以上存储过程是传入表名,输出该表字段的备注信息(字段解释)
但到了sqlserver2005却提示以下错误,请问如何改?
消息 208,级别 16,状态 1,过程 test,第 6 行
对象名 'sysproperties ' 无效。
(1 行受影响)
------解决方案--------------------SQLServer2005中取带sysproperties的系统表是:sys.extended_properties
自己去修改。
------解决方案--------------------让邹建大哥帮你解决吧!