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


Document Your Database


Document Your Database

Author
Message
steve block
steve block
Mr or Mrs. 500
Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)

Group: General Forum Members
Points: 520 Visits: 1563
The query works for me in SqlServer 2000. What version do you have?

Steve



Kris-420132
Kris-420132
SSC Rookie
SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)

Group: General Forum Members
Points: 35 Visits: 179
I'm using sql 2005

Do you by chance know how to access those objects in 2005?
steve block
steve block
Mr or Mrs. 500
Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)Mr or Mrs. 500 (520 reputation)

Group: General Forum Members
Points: 520 Visits: 1563
I haven't started using 2005 yet, but I'm sure someone on the forum can help you.

Steve



JAG-360157
JAG-360157
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 2
Hi Kris,

this is the same query for SQL 2005:


select SO.name as 'table', SC.name as field,
ST.name as datatype, SC.max_length as 'size',
sp.value as 'description'
from sys.columns SC inner join
sys.objects SO on SC.object_id = SO.object_id inner join
sys.types ST on ST.user_type_id = SC.user_type_id left join
sys.extended_properties sp on sp.major_id = so.object_id and sp.minor_id = SC.column_id
and sp.name = 'MS_Description'
where SO.type = 'U'
order by SO.name, SC.name



Regarding your second question:
if i wanted to browse these tables, how would I access them?

Just go to DB -> Views -> System views

Hope it helps.

Regards,
Jose
Kris-420132
Kris-420132
SSC Rookie
SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)SSC Rookie (35 reputation)

Group: General Forum Members
Points: 35 Visits: 179
Many thanks Jose

The script works and I found the views (I was looking under system tables before, never occurred to me to check the views)

thanks again

Kris
Jonathan AC Roberts
Jonathan AC Roberts
SSC-Addicted
SSC-Addicted (430 reputation)SSC-Addicted (430 reputation)SSC-Addicted (430 reputation)SSC-Addicted (430 reputation)SSC-Addicted (430 reputation)SSC-Addicted (430 reputation)SSC-Addicted (430 reputation)SSC-Addicted (430 reputation)

Group: General Forum Members
Points: 430 Visits: 1836
I agree, I've gone to the effort of writing a Word macro template to document SQL-Server databases. You just select an ODBC data-source for a SQL server database and it will document all the tables, indexes, triggers, stored procedures and functions on the database. It's been well tested on sql-server 2005 but I think it should also run on 2000.

If anyone would like to try it please email me at:
dbdocument at gmail dot com. Smile
brhunter-540485
brhunter-540485
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 131
Great advice. However, I think a better article would be on the practice of creating "Self Documenting" database Schemas.
Charles Kincaid
Charles Kincaid
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1041 Visits: 2383
brhunter (1/2/2008)
Great advice. However, I think a better article would be on the practice of creating "Self Documenting" database Schemas.

See Joe Celko's book "SQL Programming Style" ISBN:0-12-088797-5

ATBCharles Kincaid
SSIS Guy
SSIS Guy
Valued Member
Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)

Group: General Forum Members
Points: 51 Visits: 175
Here is one more Free Tool to document Sql Server
SSIS Guy
SSIS Guy
Valued Member
Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)Valued Member (51 reputation)

Group: General Forum Members
Points: 51 Visits: 175
Here is one more Free Tool to document Sql Server
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