Query below returns total number of tables in current database.
select count(*) as tables from MSysObjects where MSysObjects.type In (1,4,6) and MSysObjects.name not like '~*' and MSysObjects.name not like 'MSys*'
Note that we have excluded system tables (names starting with ~ or Msys).
- tables - number of tables in a database
Query returns just one row.
Those results show that there are 229 tables in the database.