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
By Mohd Zulkamal
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 =)
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 Mohd Zulkamal
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 =)