sql2005 sql 2008下得到表中列的类型和说明
作者:互联网
原文链接:http://www.cnblogs.com/TSPWater/archive/2010/05/27/1745673.html
SELECT o.name as table_name,c.name AS col_name,TYPE_NAME(c.user_type_id) AS type_name,isnull(ep.value,'') AS col_Property FROM sys.objects AS o JOIN sys.columns AS c ON o.object_id = c.object_id
LEFT JOIN sys.extended_properties ep ON c.object_id = ep.major_id and c.column_id=ep.minor_id
WHERE o.name = '表名' ORDER BY c.column_id
LEFT JOIN sys.extended_properties ep ON c.object_id = ep.major_id and c.column_id=ep.minor_id
WHERE o.name = '表名' ORDER BY c.column_id
转载于:https://www.cnblogs.com/TSPWater/archive/2010/05/27/1745673.html
标签:www,object,name,sql2005,表中列,id,sys,sql,ep 来源: https://blog.csdn.net/weixin_30344131/article/details/95302664