Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Data Dictionary?

Author  Topic 

JacobPressures
Posting Yak Master

112 Posts

Posted - 2009-03-18 : 09:24:18
There is a place in the db where you can find a description of all the fields in a table. I've used a trigger once to populate this section after creating tables and relationships. How do i find it?

Thanks!

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-03-18 : 10:04:56
run sp_help 'tablename'
Go to Top of Page

JacobPressures
Posting Yak Master

112 Posts

Posted - 2009-03-18 : 10:32:21
Thanks! I see the datatype and all but i still don't see a description of the field/column.
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2009-03-19 : 06:55:33
SELECT s.name AS SchemaOwner,
o.Name AS ObjectName,
ep.value AS PropertyValue,
c.name AS ColumnName,
c.colid AS Ordinal
FROM sys.objects o INNER JOIN sys.extended_properties ep
ON o.object_id = ep.major_id
INNER JOIN sys.schemas s
ON o.schema_id = s.schema_id
LEFT JOIN syscolumns c
ON ep.minor_id = c.colid
AND ep.major_id = c.id
WHERE o.type IN ('U') AND ep.name = 'MS_Description'
ORDER BY SchemaOwner,ObjectName, Ordinal
Go to Top of Page

JacobPressures
Posting Yak Master

112 Posts

Posted - 2009-03-19 : 10:08:17
Thanks! Wow! Thats a long query.

That's what i wanted thanks!
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2009-03-20 : 03:07:01
cheers
Go to Top of Page

JacobPressures
Posting Yak Master

112 Posts

Posted - 2009-03-20 : 13:05:33
I tried to run that same query on a different database to find out what a certain field represented and I got this message:

dbo
ProcReference
This table is a listing of stored procedures used by the application. NULL
NULL
Go to Top of Page
   

- Advertisement -