I wrote this code to make it easier to compare record counts between a live database and a restored copy to test my backups, I thought people might find it useful. You need to run it against your live side when you do the backup that you're going to restore and compare against.
Copy the output into another Query Analyzer window and run it: instant record counts.
Suck the results into Excel, run the script again against the restored DB, and you should be able to see any problems fairly quickly. I would expect perhaps a minor variation in counts, this should at least show you any radical changes.
I've only tested this under SQL Server 2000 SP3a.
Something I really hate is typing something repetitive. To prepare for our Disaster Recovery plan, I wrote this script.It is a bit strange in that it requires 2 run iterations to generate the desired result.I use a naming standard for backup files of the form:D_DBName.Bakand a naming standard for database files of the form:DBName_Dx.Mdf for […]