Monday , December 11 2017
Home / DataBase / SQL SERVER / Find all rows count and columns count in single database in sql server

Find all rows count and columns count in single database in sql server

In General for any database it contains lot of tables, if we want to find rows count and columns count for any table we need to write individual query for each and every table.

but in sql server we have a stored procedure called sp_msforeachtable it will return all table names and their rows count

by using sp_msforeachtable in below query we can find all tables rows and columns count along with table size

output:

sp_msforeachtable rows count

if we want to get order by using data size run below query it will fetch records using datasize of the tables

output:

sp_msforeachtable rows count

Conclusion:

We hope you find the tip as helpful,  I hope you liked the article. Please share your valuable suggestions and feedback in the comments.

Print Friendly, PDF & Email

Give us your valuable feedback

comments

About Murali

Hello everyone I am Software Developer having 3+ years of Experience in Microsoft Technologies and Others. My skills :- Asp.net, C#,Ado.net, SQL SERVER, web services, windows Service,Windows applications,HTML,CSS, JavaScript,JQuery,AnjularJs

Check Also

dbForge-Studio-for-SQL-Server

dbForge Studio for SQL Server – Ultimate SQL Server Manager Tool from Devart

dbForge Studio for SQL Server is a powerful IDE for SQL Server management, administration, development, …

%d bloggers like this: