Please start any new threads on our new site at 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
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Query a list of all tables in a database.
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

65 Posts

Posted - 03/05/2014 :  18:00:36  Show Profile  Reply with Quote
I'm running SQL Server 2012 Express. I need to query a database and return the list of tables in the database. Can someone please help me construct this query?

Thank you,


Flowing Fount of Yak Knowledge

4614 Posts

Posted - 03/05/2014 :  18:33:12  Show Profile  Reply with Quote
Go to Top of Page

Yak Posting Veteran

65 Posts

Posted - 03/05/2014 :  18:54:55  Show Profile  Reply with Quote
Got it......answer is:

SELECT * FROM information_schema.tables
Go to Top of Page

Premature Yak Congratulator

22864 Posts

Posted - 03/06/2014 :  06:39:05  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Another method

EXEC sp_tables


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

Flowing Fount of Yak Knowledge

2167 Posts

Posted - 03/06/2014 :  07:08:18  Show Profile  Reply with Quote
how about
select name from sys.tables 
where type = 'U'

How to ask:

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.02 seconds. Powered By: Snitz Forums 2000