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.

Comments

Popular posts from this blog

Insecure cookie setting: missing Secure flag

Maximum Stored Procedure Function Trigger or View Nesting Level Exceeded (limit 32) in SQL Server

Display Line Chart Using Chart.js MVC C#