SQL Server查询字段说明

select  c  . name ,  isnull ( ETP  . value ,  '' )  as  Des
FROM  syscolumns  c
inner  join  systypes  t  on  c .  xusertype  =  t .  xusertype
left  join  sys .  extended_properties  ETP  on  ETP . major_id  =  c . id
and  ETP  . minor_id  =  c  . colid
and  ETP  . name  = 'MS_Description'
left  join  syscomments  CM  on  c .  cdefault = CM  . id
where  c  . id  =  object_id  ( '表名'  )

你可能感兴趣的:(SQL Server)