Cloud Training (Online)




How to Get the Number of Tables from SQL Server Database ?

Below is a sample SQL query that demonstrates how to count the number of tables in a SQL Server database using information_schema.tables.

How to Get the Number of Tables from SQL Server Database ?

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

Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.