Feb 4, 2011

Count of Tables of SQL 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 YOURDBNAME
Select COUNT(*) from information_schema.tables
WHERE table_type = 'base table'

' Will return you the count of the tables in the database

No comments:

Post a Comment

Hi,

Thanks for your visit to this blog.
We would be happy with your Queries/Suggestions.