Follow SQLMaster on Twitter
Welcome to SqlServer-QA.net Sign in | Help

TSQL to get FieldName & FieldDescription within a SQL Server database

When you are documenting a database including the table-column information you need to have a description that can specify that so and so column is used for such a purpose. Think about accessing such information using Enterprise Manager or SS Management Studio, you have perform the chore by right-clicking on a table and choosing Design Table, on the Columns tab - "Description". Using the following TSQL you can get this information:

select cols.table_name, cols.column_name, sp.value as [description] from information_schema.columns cols
left join sysproperties sp on sp.id = object_id('syslogins') and sp.smallid=cols.ordinal_position and sp.name='MS_Description'
where cols.table_name='syslogins'

Published Wednesday, July 25, 2007 7:52 AM by SQL Master

Comments

# TSQL to get FieldName & FieldDescription within a SQL Server database

When you are documenting a database including the table-column information you need to have a description

Wednesday, July 25, 2007 1:12 PM by SSQA.net - SqlServer-QA.net

# Rhonda Tipton’s WebLog Links - 07.29.07 «

Sunday, July 29, 2007 5:02 PM by Rhonda Tipton’s WebLog Links - 07.29.07 «
Anonymous comments are disabled