查询表的脚本

SELECT C.column_id AS 序号,C.[name] AS 列名,S.[name] AS 类型,C.max_length AS 长度,C.scale AS 精度,P.[value] AS 字段描述,C.collation_name as 排序规则 
FROM SYS.tables AS T 
INNER JOIN SYS.columns AS C 
ON T.object_id=C.object_id 
INNER JOIN SYS.TYPES AS S 
ON C.user_type_id=S.user_type_id left join sys.extended_properties P
ON P.major_id=T.[object_id]
AND P.minor_id=C.column_id  
WHERE T.[name]='TA_WEBUserRegist' AND P.[name]='MS_Description';

  

posted @ 2018-12-18 18:31  Joe·Zhou  阅读(294)  评论(0编辑  收藏  举报