I have a large database having a total table count of more than 100, and in some tables, the total records count is more than 20 Cr. So I use Count() for each table it takes so much time to get the total record count of all tables. Can anyone help me with how can I get all the records count of all tables in less time?
Thank you.
Amit MohantyPosted Jun 20, 2022, 6:59 AM
if you want all table with total count then use exec sp_msforeachtable 'exec sp_spaceused [?]'
You can insert the above query result in a table like below query.
Sachin SinghPosted Jun 20, 2022, 6:40 AM