Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Table Defination

Author  Topic 

jpockets
Starting Member

45 Posts

Posted - 2007-12-20 : 10:53:22
I just got access to another DB and there is a table in there that has over 300 columns, the boss wants a print out of every column, is there a command in sql that list the columns and their data definations? So i can just export the results to excel?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2007-12-20 : 10:55:46
sp_help TABLENAME

lists all columns,indexes,constraints related to table
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2007-12-20 : 10:56:03
sp_help <TableName>
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-12-20 : 10:56:34
sp_help tablename



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2007-12-20 : 10:58:03
USE

Sp_tables
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2007-12-20 : 10:58:51
For databases and their sizes:

sp_databases
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2007-12-20 : 10:59:44
quote:
Originally posted by sodeep

USE

Sp_tables


No, that will just give you the schema/owner/tablename info.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2007-12-20 : 11:03:44
Sorry i mean

sp_columns 'table name'
Go to Top of Page

jpockets
Starting Member

45 Posts

Posted - 2007-12-20 : 11:04:19
Thanks Guys for the help, saved me a lot of time.
Go to Top of Page
   

- Advertisement -