...

View Full Version : MSSQL: Select Column Descriptions from a Table



Basscyst
01-04-2007, 10:08 PM
I'm using MS SQL, I'm wondering if anyone knows a way for me to retrieve a column's description in a query. I can get everything else, Identity seed, data type etc. just can't seem to find any info on retrieving the description.

Thanks,
Basscyst

nikkiH
01-04-2007, 10:39 PM
Meta data?

SELECT *
FROM INFORMATION_SCHEMA.Tables T JOIN INFORMATION_SCHEMA.Columns C
ON T.TABLE_NAME = C.TABLE_NAME
WHERE T.TABLE_NAME = 'yourTablename'
ORDER BY C.COLUMN_NAME

Basscyst
01-04-2007, 11:29 PM
Yeah, all the examples I've found give me that data, but it doesn't include the data I'm interested in. The highlighted field in the image below is what I am looking for.

http://www.enegam.com/examp.jpg

Thanks,
Basscyst

vinyl-junkie
01-05-2007, 03:20 AM
Starting with MySQL 5.0, it appears that you can get this information using the Information_Schema database. You can read more about it here (http://dev.mysql.com/doc/refman/5.0/en/information-schema.html).

guelphdad
01-05-2007, 04:38 AM
The OP is using MSSQL and not MySQL. I'll move the thread to the general database area.

Roelf
01-05-2007, 07:01 AM
That information is stored in the table 'sysproperties' as binary data , joinable with the id of the column in 'sysobjects'

Basscyst
01-05-2007, 06:10 PM
Perfect! Thanks a million.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum