Read SQL Server table field comments

use database
SELECT
A.name AS table_name,
B.name AS column_name,
C.value AS column_description
FROM sys.tables A
INNER JOIN sys.columns B ON B.object_id = A.object_id
LEFT JOIN sys.extended_properties C ON C.major_id = B.object_id AND C.minor_id = B.column_id
WHERE A.name = 'table name'

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326984280&siteId=291194637