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.
| 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 moretable(s) in a database, using possibly a SELECT; I need to retrievethe composition of the DB I'm working onto to attach it in some docsabout the webapp I'm currently developing. I think I've seen a thinglike 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 SELECTWhat do you mean by Select?MadhivananFailing to plan is Planning to fail |
 |
|
|
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' |
 |
|
|
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 |
 |
|
|
|
|
|