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 |
|
swapna123
Starting Member
3 Posts |
Posted - 2007-01-12 : 11:37:10
|
Hi,I was wondering if there is a way to export just the table names of all the tables in a sql database to an excel spreadsheet. Can I also see the table structure, like which are the parent tables and which are the child tables? Please let me know. I'm using SQL server 2005.Thanks. |
|
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2007-01-12 : 11:43:49
|
| Take a look at the INFORMATION_SCHEMA views in Books Online. Everything you want is there. |
 |
|
|
swapna123
Starting Member
3 Posts |
Posted - 2007-01-12 : 14:26:16
|
How do I get the tables structure? I got the list of table objects by querying the sysobject. But I could not figure out how to get the tables structure. Is there a way I could do that? I'm interested in parent-child relationships among the tables. Thanks. |
 |
|
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2007-01-12 : 15:04:18
|
| Yes, you'll get that from the INFORMATION_SCHEMA views, for example part of what you want is definitely in INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
|
|
swapna123
Starting Member
3 Posts |
Posted - 2007-01-12 : 16:31:28
|
| Thanks. I got it all now. :) |
 |
|
|
|
|
|