views:

563

answers:

4

I have like 20 or so tables in the database RentalEase and I want to print them out (physically) so I can look at them easier. I don't care too much about what data is in them, just their structure. How can I do this?

It's an SQL Express server and I'm using Microsoft SQL Server Management Studio Express to manage it. I remember back when I was using MySQL and PHP I could use a DESCRIBE to print it out but I don't remember how I did it. There doesn't seem to be a DESCRIBE for SQL Server

+4  A: 

try:

sp_help <table_name>
Robin
I use this daily, but you can drop the EXEC
banjollity
No fair! You edited it...
banjollity
A: 

You can use Database Schema Diagram Design Tool. Just drop all the tables there, and you will get the diagram of you database including all keys

Alex Reitbort
+1  A: 

In Management Studio,

  1. Go to the Tables view for your database
  2. select all tables (on the right hand side list view)
  3. right click
  4. Script table As -> Create To
  5. File or Clipboard

This will produce a script file containing all of the selected file schema definitions.

Ash
A: 

You can always inspect the INFORMATION_SCHEMA views to find all the interesting information about tables and their columns.

It's not called "describe" per se - but this query will show you lots of information:

select * from Information_schema.Columns
where table_name = '(your table here)'

Marc

marc_s