Search This Blog

Wednesday, March 16, 2011

How to find row counts for all the tables in one DB

CREATE  TABLE #t 
(name SYSNAME, rows CHAR(11), reserved VARCHAR(18), data VARCHAR(18),index_size VARCHAR(18), unused VARCHAR(18))
EXEC sp_msforeachtable 'INSERT INTO #t EXEC sp_spaceused ''?'''

No comments:

Post a Comment