C# 获取sql数据库表列名,及列名说明备注信息

 获取指定表列名及备注:



select * from syscolumns where id=object_id(N'表名')
SELECT a.name [column], b.name type, a.prec length, isnull(c.value, ' ') [description] FROM syscolumns a LEFT OUTER JOIN systypes b ON a.xusertype = b.xusertype LEFT OUTER JOIN sys.extended_properties c ON a.id = c.major_id AND a.colid = c.minor_id WHERE a.id = object_id('表名')

 

posted @ 2014-04-09 15:10  gds111789  阅读(2862)  评论(0编辑  收藏  举报