Solved

Retrieving table and column descriptions from SQL Server

Posted on 2004-09-01
2
233 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

707 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now