Find Number Of Tables in Database
To use Count() function as Returns the Number of Rows or values of the Specified Column:
SELECT COUNT(column_name) FROM table_name;
In this above code find Number Of Rows in Specified Columns. And we can find Number of Tables in the Database In SQL Server 2008 or 2012.
USE DB_news --DB_news as Database Name
SELECT COUNT(*) from information_schema.tables
WHERE table_type = 'base table'
It will Be Shown the Number of Tables in the Selected Database.
SELECT COUNT(column_name) FROM table_name;
In this above code find Number Of Rows in Specified Columns. And we can find Number of Tables in the Database In SQL Server 2008 or 2012.
USE DB_news --DB_news as Database Name
SELECT COUNT(*) from information_schema.tables
WHERE table_type = 'base table'
It will Be Shown the Number of Tables in the Selected Database.
Comments
Post a Comment
Thank You for your Comment