SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
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.
 New Topic  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

22847 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: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.05 seconds. Powered By: Snitz Forums 2000