how to show all the tables in a database in sql server
Jump to turn (10)
- 1how to show all the tables in a database in sql server
- 2SELECT Directorname, COUNT(DirectorID) AS 'Current count', noofmovies AS 'Total
- 3can you explain the above code that why it is group by based on director name an
- 4Column 'Director.noofmovies' is invalid in the select list because it is not con
- 5still i am unclear in group by how here we are mentioning two columns for group
- 61 Rajkumar Hirani 10 2 Sanjay Leela Bhansali 8 3 Aditya Chopra 6 4 Zoya Akhtar 3
- 7ok ...if a select statement has non aggregated value while using group by we hav
- 8so if we want to mention aggregate value we have to specify using having right?
- 9i have three table movie having columns movie name,realseyear, lead 1, lead 2,ge
- 10explain a single having condition
- User
how to show all the tables in a database in sql server
- Assistant
In SQL Server, you can query the system catalog views to list all the tables in a particular database. One common system catalog view that can be used for this purpose is
INFORMATION_SCHEMA.TABLES. Here's how you would use it:sqlUSE YourDatabaseName; GO SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';