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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Printing table structure

Author  Topic 

HCLollo
Starting Member

49 Posts

Posted - 2005-08-29 : 03:44:20
Hi to all!

I was wondering how it's possible to get the structure of one or more
table(s) in a database, using possibly a SELECT; I need to retrieve
the composition of the DB I'm working onto to attach it in some docs
about the webapp I'm currently developing. I think I've seen a thing
like this some time ago, but can't remember where (nor when...)

Thank you all in advance,
HCL

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-29 : 03:51:10
In Enterprise Manager Right click on the Database and Select "Generate SQL Script"

>>using possibly a SELECT

What do you mean by Select?

Madhivanan

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

spireite
Starting Member

12 Posts

Posted - 2005-08-29 : 04:22:24
Using a SELECT? Do you mean..........

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='xxx'
Go to Top of Page

HCLollo
Starting Member

49 Posts

Posted - 2005-08-29 : 05:09:49
Thank you spireite, that's exactly what I was looking for:

SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH FROM INFORMATION_SCHEMA.COLUMNS ORDER BY TABLE_NAME




HCL
Go to Top of Page
   

- Advertisement -