标签:join img 获取 .com select 分享 where art mssql
根据表名获取表名、字段、描述和类型长度,正好有需要的朋友们可参考添加自需的字段,sql语句如下:
1 SELECT TableName = OBJECT_NAME(cols.object_id), ColumnsName = props.name, Description = props.value, Length=cols.max_length 2 FROM sys.columns cols inner JOIN sys.extended_properties props ON 3 props.major_id = cols.object_id 4 AND props.minor_id = cols.column_id 5 AND props.name = ‘MS_Description‘ 6 WHERE OBJECTPROPERTY(cols.object_id, ‘IsMsShipped‘)=0 7 AND OBJECT_NAME(cols.object_id) =‘sf_project‘
标签:join img 获取 .com select 分享 where art mssql
原文地址:http://www.cnblogs.com/jean69/p/6139412.html