Created
March 29, 2023 07:32
-
-
Save hendrasyp/92634c8ea073edf1c9bd70a8b2e3c988 to your computer and use it in GitHub Desktop.
Describe Table Description SQL Server
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
DECLARE @TableName VARCHAR(50) = 'TXP_Header'; | |
select | |
st.name [Table], | |
sc.name [Column], | |
sep.value [Description] | |
from sys.tables st | |
inner join sys.columns sc on st.object_id = sc.object_id | |
left join sys.extended_properties sep on st.object_id = sep.major_id | |
and sc.column_id = sep.minor_id | |
and sep.name = 'MS_Description' | |
where st.name = @TableName | |
-- and sc.name = @ColumnName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment