如何读出SqlServer中对一个字段的描述

--用系統的Function來讀。fn_listextendedproperty的用法更多的可參可Books   online  
  SELECT       *  
  FROM       ::fn_listextendedproperty   (NULL,   'user',   'dbo',   'table',   'table名字',   'column',   default)  
   
  --把table名字換成你的table名字,其它的不要動,在Query   Analyzer里試一試:)

另外:如果需要和别的表关联,会报错误:
Cannot resolve the collation conflict between "Latin1_General_CI_AI" and "Chinese_PRC_CI_AS" in the equal to operation.
解决方法:用key word: collate Chinese_PRC_CI_AS
For example:
select A.field,D.value
from A
left join 
(
select objname,value from ::fn_listextendedproperty   (NULL,   'user',   'dbo',   'table',   'tableB',   'column',   default)   
as D
on A.field=D.objname collate Chinese_PRC_CI_AS


posted on 2007-08-27 16:55  Edison Zhu  阅读(367)  评论(0编辑  收藏  举报