Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing Table's structure/schema

Tags:

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

like image 503
Malfist Avatar asked Feb 14 '09 21:02

Malfist


People also ask

How do you print a database structure?

On the System submenu, click Print Database Structure. The Print Database Structure dialog box appears. Click PRINT. The Send to dialog box appears.


2 Answers

try:

sp_help <table_name> 
like image 71
Robin Avatar answered Oct 02 '22 14:10

Robin


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

like image 40
marc_s Avatar answered Oct 02 '22 16:10

marc_s