Skip to content

Instantly share code, notes, and snippets.

@hendrasyp
Created March 29, 2023 07:32
Show Gist options
  • Save hendrasyp/92634c8ea073edf1c9bd70a8b2e3c988 to your computer and use it in GitHub Desktop.
Save hendrasyp/92634c8ea073edf1c9bd70a8b2e3c988 to your computer and use it in GitHub Desktop.
Describe Table Description SQL Server
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