Saturday, January 03, 2009

Count number of tables in a SQL Server database

A simple query to find out number of tables in database is


USE YOURDBNAME

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

Enjoy...

No comments:

back to top