Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Column description


Column description

Author
Message
BG0AWI
BG0AWI
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 1
Is there a way in T-sql get the defined COLUMN DESCRIPTION text (One of the Column properties when you're in 'design table'-mode)??

/Anders

AW


AW
Antares686
Antares686
SSCrazy Eights
SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)

Group: Moderators
Points: 8424 Visits: 780
You could look at the syscomments table for the data or use the preferred fn_listextendedproperty which works but takes a bit to use, check out BOL for more information.

"Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)



G.R.Prithiviraj Kulasingham
G.R.Prithiviraj Kulasingham
SSC-Addicted
SSC-Addicted (427 reputation)SSC-Addicted (427 reputation)SSC-Addicted (427 reputation)SSC-Addicted (427 reputation)SSC-Addicted (427 reputation)SSC-Addicted (427 reputation)SSC-Addicted (427 reputation)SSC-Addicted (427 reputation)

Group: General Forum Members
Points: 427 Visits: 367
The SysProperties Table has the description.
the name should be 'MS_Description'

Here I have a sample code

select O.Name [Table_name], c.name [Column_Name],
p.Value [description]
From dbo.SysObjects O,
dbo.SysColumns C Left Outer Join
(select id, smallid, name, Value from dbo.SysProperties
Where Name = 'MS_Description') P
On P.id = c.id and P.smallid = C.Colid
Where O.id = C.id and ObjectProperty(O.id, 'ISUSERTABLE')=1
Order By O.name, c.colid

If you have different users owning tables with same file names You may have to add the table_schema too.


 
 


Cheers,
Prithiviraj Kulasingham

http://preethiviraj.blogspot.com/
Antares686
Antares686
SSCrazy Eights
SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)

Group: Moderators
Points: 8424 Visits: 780
Sorry about that sysporperties is correct. Having a murphy day here. ANyway you should learn to use the function thou as MS states system changes can change between versions but functions should remain the same.

"Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search