HomeSQL ServerHow to Get the Number of Tables from SQL Server Database ?

How to Get the Number of Tables from SQL Server Database ?

Below is a sample SQL query that demonstrates how to count the number of tables in a SQL Server database using information_schema.tables.

How to Get the Number of Tables from SQL Server Database ?

USE TrainingDB1
SELECT COUNT(*) as TableNos from information_schema.tables 
WHERE table_type = 'base table' 

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

When dealing with a relational database management system (RDBMS) like SQL Server, compatibility level is an important concept to understand....
In this blog post, let’s learn about the error message “49975 – Unable to load controller client certificate due to...
In this blog post, let’s learn about the error message “49973 – Cannot remove tempdb remote file to local tempdb...