天天看點

[sql server] 如何查詢字段的說明

--2000

Select a.name,b.value

from syscolumns a left join sysproperties  b

on a.id=b.id AND a.colid = b.smallid 

Where a.ID=OBJECT_ID('tb')

--2005

Select a.name,b.value

from sys.syscolumns a left join sys.extended_properties  b

on a.id=b.major_id AND a.colid = b.minor_id 

Where a.ID=OBJECT_ID('tb')

繼續閱讀