SQL Snippet – Get the number of tables in a database

The below SQL snippet will return a count of the number of tables in a database.

Make sure to change the “use” statement to the required database name

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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.