Technical Article

Finding no. of Rows in all tables of a datbase in one line of script

,

Mircrosoft provide a simple stored procedure that will give you result, a thousand line of t-sql code can do.

Simple run this against any database and you will get the result.

USE <YOUR_DATABASE_NAME>
GO
sp_MSforeachtable @command1="print '?'", @command2="SELECT COUNT(*) AS '?' FROM ?"

Rate

3 (15)

You rated this post out of 5. Change rating

Share

Share

Rate

3 (15)

You rated this post out of 5. Change rating