Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL 2000 - Column description?

Status
Not open for further replies.

newbby

Programmer
Mar 16, 2004
36
US
Hi,
I am using sql 2000. can anyone tell me where the column description is stored in the database?
In your design of the table, you can actually describe the column by giving it a meaningfull name in the bottom section of the design.
Thanks
 
The recommended way to find metadata information is INFORMATION_SCHEMA views (based on underlying system tables like syscolumns)
In your case:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS

while it is possible to query system tables directly, it is not a good idea
 
I do not believe running the query ...

SELECT * FROM INFORMATION_SCHEMA.COLUMNS

Will return you the desription of the field you are seeking. You will need to leverage Extended Properties.

Thanks

J. Kusch
 
Try this ...

Code:
SELECT   *
FROM   ::fn_listextendedproperty (NULL, 'user', 'dbo', 'table', 'TestMe', 'column', default)

Replace TestMe above w/ your table name.

Thanks

J. Kusch
 
Extended properties cannot be specified in the CREATE TABLE statement . They must be added with sp_addextendedproperty prosedure.
and later retrieved with FN_LISTEXTENDEDPROPERTY function.

All "standard" properties specified at design time could be retrieved with
SELECT COLUMNPROPERTY( OBJECT_ID('<table_name>'),'<column_name>','<property_name>')
 
Thanks to all,
JayKusch's post helped me a lot with the exact info I was looking for. Thanks MarkV11 for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top