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
 printing Table and columns properties info

Author  Topic 

latingntlman
Yak Posting Veteran

96 Posts

Posted - 2005-12-14 : 10:50:42
I'm kinda new to SQL. I'm trying to get a print out of a specific table and its columns and column types. Is there a specific command or code that I can use to accomplish this?.

thx,



Newbie.

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2005-12-14 : 12:25:55
1. sp_help 'TblName'
or
2. SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'TblName'
or
3. Select * from SYSCOLUMNS Where ID In (Select ID From SYSOBJECTS Where Name = 'TblName')
or some more
Go to Top of Page

latingntlman
Yak Posting Veteran

96 Posts

Posted - 2005-12-14 : 13:32:08
I got it. it worked!!

Thanks Srinika
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-15 : 00:00:46
Also you can generate the Script of that table from Enterprise Manager

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -