DB Checker

The integrity of each database should be periodically checked using the DBCC CHECKDB and DBCC NEWALLOC statements. This should especially be performed just before a database is dumped, because some types of problems in a database affect the integrity of the dump file. The Dbchkcrs.sql and Dbchktbl.sql files are scripts that will read the sysdatabases table to get a list of the existing databases on the system, then build a script that can be used to run the DBCC integrity checks on all of the databases. Dbchkcrs.sql does this by selecting the database names into a cursor. Dbchktbl.sql is for SQL Server version 4.2 and earlier that did not support server cursors.