Thursday, October 28, 2010

Getting record counts for all tables in specific database

Getting list of record count of all tables in specific database,

Query:
sp_msforeachtable '
declare @rowcnt int
select @rowcnt=count(*) from ?
if (@rowcnt>0)
print "?" + str(@rowcnt)
'

No comments: