许松--永恒学习屋
努力并不一定会成功,但放弃一定会失败!

 

SELECT Sysobjects.name AS tablename, syscolumns.Id, syscolumns.name AS name,
systypes.name AS type, syscolumns.length as size,
sys.extended_properties.[value] AS columnDesc,  syscomments.text as
COLUMN_DEFAULT,syscolumns.isnullable as IS_NULLABLE FROM syscolumns
INNER JOIN systypes
    ON syscolumns.xtype = systypes.xtype
    LEFT JOIN sysobjects ON syscolumns.id = sysobjects.id
  LEFT OUTER JOIN sys.extended_properties ON
  ( sys.extended_properties.minor_id = syscolumns.colid
    AND sys.extended_properties.major_id = syscolumns.id)
  LEFT OUTER JOIN syscomments ON syscolumns.cdefault = syscomments.id
  WHERE syscolumns.id IN
    (SELECT id FROM SYSOBJECTS WHERE xtype = 'U') AND (systypes.name <> 'sysname')
    ORDER BY syscolumns.colid

posted on 2010-11-04 11:00  yongheng's blogs  阅读(261)  评论(0编辑  收藏  举报