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
 export SQL table names to Excel.

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.
Go to Top of Page

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.
Go to Top of Page

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
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-01-12 : 15:39:46
and for export to excel you can use this:
http://weblogs.sqlteam.com/mladenp/archive/2006/07/25/10771.aspx



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

swapna123
Starting Member

3 Posts

Posted - 2007-01-12 : 16:31:28
Thanks. I got it all now. :)
Go to Top of Page
   

- Advertisement -