日期:2014-05-18  浏览次数:20464 次

问句sql的含义
SELECT   a.name,   a.prec,   CAST(d.value   AS   nvarchar(4000))     FROM   (
syscolumns   a   INNER   JOIN   sysobjects   b   ON   a.id   =   b.id  
INNER   JOIN   sysindexkeys   c   ON   a.colid   =   c.colid   AND   b.id   =   c.id   AND   c.indid   =   1
LEFT   OUTER   JOIN   ::fn_listextendedproperty( 'MS_Description ',   'user ',   'dbo ',   'TABLE ',   @ViewRef,   'column ',   DEFAULT)   d   ON   a.name   =   d.objname     )   WHERE   b.type   =   'U '

这个是什么意思呀



------解决方案--------------------
DECLARE @ViewRef VARCHAR(80)
SELECT a.name, a.prec, CAST(d.value AS nvarchar(4000)) FROM (
syscolumns a INNER JOIN sysobjects b ON a.id = b.id
INNER JOIN sysindexkeys c ON a.colid = c.colid AND b.id = c.id AND c.indid = 1
LEFT OUTER JOIN ::fn_listextendedproperty( 'MS_Description ', 'user ', 'dbo ', 'TABLE ',
@ViewRef, 'column ', DEFAULT) d ON a.name = d.objname ) WHERE b.type = 'U '

name prec 无列名
id 10 NULL
property 64 NULL