Getting the column description from SQL Server

  • Thread starter Thread starter rguti
  • Start date Start date
R

rguti

Hi,

Does anybody know how to get the column description for a table in SQL
Server 2000?

Thanks.
 
Hi!

Look up the sp_columns stored procedure in the T-SQL reference :

ex :
-- in T-SQL
sp_columns 'my_table'
 
select value from ::fn_listextendedproperty ('MS_Description', 'user',
'dbo', 'table', 'MyTable', 'column', 'Column1')
'MS_Description' is the description property of the column that you are
looking for; 'MyTable' is the table name and
'Column1' is the column for which you want the description. Note the special
syntax of this function (two prefixed colons) .
You can lookup the syntax and example of this function in sql server books
online for further details.
 
Thanks! That did it.


Imran Koradia said:
select value from ::fn_listextendedproperty ('MS_Description', 'user',
'dbo', 'table', 'MyTable', 'column', 'Column1')
'MS_Description' is the description property of the column that you are
looking for; 'MyTable' is the table name and
'Column1' is the column for which you want the description. Note the special
syntax of this function (two prefixed colons) .
You can lookup the syntax and example of this function in sql server books
online for further details.
 
Back
Top