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';
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy