Click here to Skip to main content
15,895,084 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?
Posted

Hi ,

Use this command

select * from sys.tables
 
Share this answer
 
Comments
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
 
Try
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