View Full Version : MSSQL: Select Column Descriptions from a Table
01-04-2007, 11: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.
01-04-2007, 11:39 PM
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
01-05-2007, 12:29 AM
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.
01-05-2007, 04: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).
01-05-2007, 05:38 AM
The OP is using MSSQL and not MySQL. I'll move the thread to the general database area.
01-05-2007, 08:01 AM
That information is stored in the table 'sysproperties' as binary data , joinable with the id of the column in 'sysobjects'
01-05-2007, 07:10 PM
Perfect! Thanks a million.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.