其他分享
首页 > 其他分享> > 啊啊啊啊啊啊啊啊啊啊啊啊

啊啊啊啊啊啊啊啊啊啊啊啊

作者:互联网

SELECT
    obj.name AS 'tableName'
    ,CASE WHEN pro.value IS NULL or pro.value = '' THEN obj.name ELSE CONVERT( NVARCHAR(MAX), pro.value) END AS 'tableDescription'
FROM
    (
        SELECT
            id
             ,name
        FROM
            sys.sysobjects
        WHERE
            xtype in ('U', 'S') -- U:用户创建的表,S:系统自带的表
    ) obj
        left join sys.extended_properties pro on pro.name = 'MS_Description' AND pro.minor_id = 0 and pro.major_id = obj.id
ORDER BY obj.name;

标签:obj,name,pro,value,啊啊啊,id
来源: https://www.cnblogs.com/abministrator/p/16276135.html