Go Back   CodingForums.com > :: Server side development > MySQL > Other Databases

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-04-2007, 10:08 PM   PM User | #1
Basscyst
Smokes a Lot


 
Join Date: Jul 2003
Location: CA, USA
Posts: 1,594
Thanks: 5
Thanked 20 Times in 20 Posts
Basscyst is on a distinguished road
MSSQL: Select Column Descriptions from a Table

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
__________________
Helping to build a bigger box. - Adam Matthews

Last edited by guelphdad; 01-05-2007 at 04:40 AM.. Reason: add database
Basscyst is offline   Reply With Quote
Old 01-04-2007, 10:39 PM   PM User | #2
nikkiH
Senior Coder

 
nikkiH's Avatar
 
Join Date: Jun 2005
Location: Near Chicago, IL, USA
Posts: 1,973
Thanks: 1
Thanked 32 Times in 31 Posts
nikkiH is on a distinguished road
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
__________________

If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit
http://www.kaelisspace.com/
nikkiH is offline   Reply With Quote
Old 01-04-2007, 11:29 PM   PM User | #3
Basscyst
Smokes a Lot


 
Join Date: Jul 2003
Location: CA, USA
Posts: 1,594
Thanks: 5
Thanked 20 Times in 20 Posts
Basscyst is on a distinguished road
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.



Thanks,
Basscyst
__________________
Helping to build a bigger box. - Adam Matthews
Basscyst is offline   Reply With Quote
Old 01-05-2007, 03:20 AM   PM User | #4
vinyl-junkie
$object->toCD-R(LP);


 
vinyl-junkie's Avatar
 
Join Date: Jun 2003
Posts: 3,053
Thanks: 2
Thanked 22 Times in 22 Posts
vinyl-junkie is on a distinguished road
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.
__________________
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
SNAP to it!
vinyl-junkie is offline   Reply With Quote
Old 01-05-2007, 04:38 AM   PM User | #5
guelphdad
Super Moderator


 
guelphdad's Avatar
 
Join Date: Mar 2006
Location: St. Catharines, Ontario Canada
Posts: 2,629
Thanks: 4
Thanked 147 Times in 138 Posts
guelphdad will become famous soon enoughguelphdad will become famous soon enough
The OP is using MSSQL and not MySQL. I'll move the thread to the general database area.
guelphdad is offline   Reply With Quote
Old 01-05-2007, 07:01 AM   PM User | #6
Roelf
Senior Coder

 
Join Date: Jun 2002
Location: Zwolle, The Netherlands
Posts: 1,110
Thanks: 2
Thanked 28 Times in 28 Posts
Roelf is on a distinguished road
That information is stored in the table 'sysproperties' as binary data , joinable with the id of the column in 'sysobjects'
Roelf is offline   Reply With Quote
Old 01-05-2007, 06:10 PM   PM User | #7
Basscyst
Smokes a Lot


 
Join Date: Jul 2003
Location: CA, USA
Posts: 1,594
Thanks: 5
Thanked 20 Times in 20 Posts
Basscyst is on a distinguished road
Perfect! Thanks a million.
__________________
Helping to build a bigger box. - Adam Matthews
Basscyst is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:44 PM.


Advertisement
Log in to turn off these ads.