sp_dbcc_runcheck

Description

Runs dbcc checkstorage on the specified database, then runs sp_dbcc_summaryreport or a report you specify.

Syntax

sp_dbcc_runcheck dbname [, user_proc]

Parameters

dbname

specifies the name of the database on which the check is to be performed.

user_proc

specifies the name of the dbcc stored procedure or a user-created stored procedure that is to be run instead of sp_dbcc_summaryreport.

Examples

Example 1

Checks the database engdb and generates a summary report on the information found:

sp_dbcc_runcheck "engdb"

Example 2

Checks the database pubs2 and generates a full report:

sp_dbcc_runcheck "pubs2", sp_dbcc_fullreport

Usage

Permissions

The permission checks for sp_dbcc_runcheck differ based on your granular permissions settings.

Granular permissions enabled

With granular permissions enabled, you must have the dbcc checkstorage and dbcc checkvverify privileges on the specified database.

Granular permissions disabled

With granular permissions disabled, you must be the database owner of the specified database or a user with sa_role.

See also

Commands dbcc

dbcc stored procedures sp_dbcc_summaryreport