Created
March 14, 2019 09:56
-
-
Save kshimi/a1835603a21178bbebe19e7b14f8c6d1 to your computer and use it in GitHub Desktop.
SQLServer get column comment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--カラムの説明 | |
SELECT | |
t.name AS 'TableName', | |
c.name AS 'ColumnName', | |
ep.name AS 'PropertyName', | |
ep.value AS 'PropertyValue' | |
FROM | |
sys.tables t | |
INNER JOIN | |
sys.columns c | |
ON | |
c.object_id = t.object_id | |
INNER JOIN | |
sys.extended_properties ep | |
ON | |
ep.major_id = c.object_id | |
AND | |
ep.minor_id = c.column_id | |
WHERE | |
ep.name LIKE 'MS_Description' | |
AND t.name = 'NAMES' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment