SQL Server2000中字段的描述存放在什么地方?(20分)

  • 主题发起人 主题发起人 jdelphi
  • 开始时间 开始时间
J

jdelphi

Unregistered / Unconfirmed
GUEST, unregistred user!
SQL Server2000中建立表结构时,有描述一项,可以填写中文意思。
描述中填写的内容存放在SQL Server2000的什么地方?
 
db中系统表syscolumns中
 
从这个表里的那个字段可以获得描述信息那?
 
SELECT C.Name 字段名称,t.name 字段类型 FROM SysColumns C, SysObjects O,systypes T
WHERE C.Id = O.Id and c.xtype=t.xtype and O.Name ='your_tablename' ORDER BY c.name DESC
 
这样可以得到字段名称和字段类型, 描述信息还是没有?
敬请老兄指教??
 
描述在sysproperties 表中
例:
SELECT a.name AS 表, b.name AS 字段, c.name AS 类型, b.length AS 长度,
d.[value] AS 描述
FROM systypes c RIGHT OUTER JOIN
sysproperties d RIGHT OUTER JOIN
syscolumns b INNER JOIN
sysobjects a ON b.id = a.id ON d.smallid = b.colid AND d.id = a.id ON
c.xtype = b.xtype
WHERE (a.xtype = 'u') AND (a.name = 'T_VIP')
SELECT a.name AS 表, b.name AS 字段, c.name AS 类型, b.length AS 长度,
d.[value] AS 描述
FROM systypes c RIGHT OUTER JOIN
sysproperties d RIGHT OUTER JOIN
syscolumns b INNER JOIN
sysobjects a ON b.id = a.id ON d.smallid = b.colid AND d.id = a.id ON
c.xtype = b.xtype
WHERE (a.xtype = 'u') AND (a.name = 'T_VIP')
 
实现了给jlhrich老兄加分!!!
 
接受答案了.
 

Similar threads

后退
顶部