Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to print a table spec

Status
Not open for further replies.

victora

Programmer
Feb 11, 2002
118
US
I need to print a table layout. Is there a command or a tool to print all fields and its properties? I need this to document all tables in our SQL database. Or better yet, if theres a tool that prints all table specs, maybe by wild card on table names...

Thank you
 
Microsoft Visio does a good job.

Or you can try
Code:
select a1.name as tablename, a2.name as columnname, a3.name as datatype	
from dbo.sysobjects a1
join dbo.syscolumns a2 on a2.id = a1.id
join dbo.systypes a3 on a3.xtype = a2.xtype
order by a1.[name]
to get just the list
 
dky1e,
thanks for the prompt reply. I have a Visio 2002 but I did not know you can use it to document table specs of a SQL DB.
Can u tell me how? How can I connect my Visio to my SQL

VA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top