Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Column description Expand / Collapse
Author
Message
Posted Monday, March 25, 2002 5:22 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, December 1, 2003 12:00 AM
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
Post #3209
Posted Monday, March 25, 2002 5:44 AM
SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: Moderators
Last Login: 2 days ago @ 1:24 PM
Points: 8,370, Visits: 743
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)



Post #30485
Posted Monday, March 25, 2002 6:18 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, September 16, 2014 1:00 PM
Points: 421, Visits: 364
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/
Post #30486
Posted Monday, March 25, 2002 11:15 AM
SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: Moderators
Last Login: 2 days ago @ 1:24 PM
Points: 8,370, Visits: 743
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)



Post #30487
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse