Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 List of all tables & columns in my db?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jodders
Starting Member

United Kingdom
41 Posts

Posted - 02/27/2013 :  11:02:34  Show Profile  Reply with Quote
Hi guys,

I plan on having a clear up on my Database which has hundreds of tables that I have created and I really need to do a bit of housekeeping. Is there a way of displaying them via SQL or outputting them all into Excel?

Your help is most appreciated.

Thanks
Jodders

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 02/27/2013 :  11:20:41  Show Profile  Reply with Quote
Any of these.
SELECT * FROM INFORMATION_SCHEMA.TABLES;
SELECT * FROM INFORMATION_SCHEMA.COLUMNS;
SELECT * FROM sys.tables;
SELECT OBJECT_NAME(OBJECT_ID) AS TableName,* FROM sys.columns;

Go to Top of Page

jodders
Starting Member

United Kingdom
41 Posts

Posted - 02/28/2013 :  04:13:24  Show Profile  Reply with Quote
Cheers buddy, that did the trick
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000