导航

获取SQL Server 2005 中使用到的数据类型

Posted on 2012-03-13 22:09  毅无涯  阅读(111)  评论(0编辑  收藏  举报

SELECT distinct B.NAME
FROM   SYSCOLUMNS A
       LEFT JOIN SYSTYPES B
         ON A.XUSERTYPE = B.XUSERTYPE
       INNER JOIN SYSOBJECTS D
         ON A.ID = D.ID
            AND D.XTYPE = 'U '
            AND D.NAME <> 'DTPROPERTIES '
       LEFT JOIN SYSCOMMENTS E
         ON A.CDEFAULT = E.ID
       LEFT JOIN sys.extended_properties G
         ON A.ID = G.major_id
            AND A.COLID = G.minor_id
       LEFT JOIN sys.extended_properties F
         ON D.ID = F.major_id
            AND F.minor_id = 0