Click here to Skip to main content
15,663,239 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is the query to display all the tables in a database of sql server?

Hi ,

Use this command

select * from sys.tables
Share this answer
narla.venkatesh 20-Sep-12 5:53am    
Hi Abhijith..
that command is giving only system tables those are created as default by the system not from our database..
Abhijit Parab 20-Sep-12 6:24am    
no. this query will show all the table. check the 'type' and 'type_desc' column in sys.tables. It stand for user defined tables.
select * from sys.objects where type = 'U'
Share this answer
SELECT * FROM information_schema.tables
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900