Count number of tables in a SQL Server database

I got a request from a user and he wanted to count the number of tables in a database. It's quiet simple. Just use the information_schema.tables

USE <db name>
SELECT COUNT(*) from information_schema.tables
WHERE table_type = 'base table'

Will return you the count of the tables in the database

The Tables













The sql statement 

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



The Output







By
NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks =)

Popular posts from this blog

How to create zip file to download in JSP- Servlet

How to create DataGrid or GridView in JSP - Servlet

Pinging in ASP.NET Example