Database Testing

How would you check the database integrity testing through SQL?

Questions by Q50281

Showing Answers 1 - 1 of 1 Answers


  • Nov 28th, 2011

Check database integrity

Check the allocation and structural integrity of user and system tables, and indexes in the database, by running the DBCC CHECKDB Transact-SQL statement. This ensures that any integrity problems with the database are reported, thereby allowing them to be addressed later by a system administrator or database owner.

Include indexes

Check the data and index pages in the database during the integrity tests.

Attempt to repair any minor problems

Attempt to correct any minor problems detected during the database integrity tests automatically. When this option is selected, the database will be put in single user mode each time the maintenance plan runs. It is recommended that this option be selected.

Exclude indexes

Check only the data pages in the database during integrity tests. This does not check indexes. This option executes faster than clicking Include indexes because fewer pages in the database are checked.

Perform these tests before doing backups

Cause the database and/or internal data integrity tests to be executed before backing up the database or transaction log. If the integrity tests detect inconsistencies, any subsequent database or transaction log backup is not backed up.


Set the frequency that the data integrity tasks (scheduled using SQL Server Agent) are executed. The default is every Sunday at 12:00 midnight.


Change the default schedule.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions