Solved

Retrieving table and column descriptions from SQL Server

Posted on 2004-09-01
2
268 Views
Last Modified: 2006-11-17
In SQL Server's Enterprise manager I enter a line of documentation for each new table and column that I create.

 Is there an easy way to retrieve this information from the database such that it may be included in our system documentation?
0
Comment
Question by:pcpaasche
2 Comments
 
LVL 10

Accepted Solution

by:
Jay Toops earned 125 total points
ID: 11951724
See if this gives you what you need.

select so.name as [table] , sc.name as [type], st.name as [subtype], sc.length, sp2.name as xtype, sp2.value as comment
from sysobjects as so
inner join syscolumns as sc
on sc.id = so.id
inner join systypes as st
on sc.xusertype = st.xusertype
left outer join sysproperties as sp2
on sp2.id = so.id
and sp2.type = 4
and sp2.smallid = sc.colid
where so.xtype='u'
order by so.name

Try this query

Jay
0
 

Author Comment

by:pcpaasche
ID: 11956673
Thanks. I will try it out when I am back at the office on monday.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Powershell help for creating accounts 283 56
Logical Operator should return Integer value in SSIS 9 39
SQL- GROUP BY 4 25
SQL profiler 3 19
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question