September 17, 2012 at 10:58 am
Hi,
Please tell me how can I check column comments or description of column in SQL Server.
Regards
Vibhu
September 17, 2012 at 11:04 am
vibhu22oct (9/17/2012)
Hi,Please tell me how can I check column comments or description of column in SQL Server.
Regards
Vibhu
A little vague as I am not quite sure what you are asking here.
September 17, 2012 at 11:13 am
Right click the table or column and select properties. Look in the extended properties.
If the database has a diagram, check the description field in the properties of the table or column.
September 17, 2012 at 3:41 pm
You can also query that data from the "ms_description" extended property.
-- Gianluca Sartori
September 17, 2012 at 3:42 pm
Thanks! Didn't know about that function.
September 17, 2012 at 3:50 pm
kl25 (9/17/2012)
Thanks! Didn't know about that function.
Another option is querying sys.extended_properties directly.
-- Gianluca Sartori
September 17, 2012 at 4:14 pm
Thanks again. Should have figured there was a catalog view but didn't know about it either. Based on the view suggested, the OP may find the following helpful:
Select
schema_name(so.schema_id) as 'schema',
so.name as 'table',
Coalesce(sc.name, '--') as 'column',
sep.value as 'description'
From
sys.extended_properties sep
Inner join
sys.objects so
On
sep.major_id = so.object_id
Left outer join
sys.columns sc
On
so.object_id = sc.object_id and
sep.minor_id = sc.column_id
Where
sep.name = 'MS_Description' and
so.type = 'U';
August 18, 2022 at 1:24 am
This was removed by the editor as SPAM
November 4, 2022 at 8:50 am
This was removed by the editor as SPAM
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply