Allows the user to create and manage persistent exclusion lists for use by checkverify and sp_dbcc_faultreport.
sp_dbcc_exclusions dbname, op, type, exclusion_list
is the name of the database for which the exclusions apply, or null if it applies to all databases.
is the operation you want to perform. Valid values are:
add – registers new exclusions (duplicates are ignored).
drop – drops the specified exclusions if they were previously registered
listall – lists the recorded exclusions for all databases.
is the type of item to be excluded. Accepted values are faults, tables, combo, or null (when op is either null or listall). Type, varchar.
is a comma-separated list of faults, tables, table and fault entries, or nulls. Type, varchar.
Excludes the tables syslogs and syscomments from sp_dbcc_faultreport processing on all databases:
sp_dbcc_exclusions null, 'add', 'tables', 'syslogs, syscomments'
Excludes fault type 100036 from processing of the database my_db:
sp_dbcc_exclusions my_db, 'add', 'faults', '100036'
Adds the following to the exclusion list corresponding to my_db: fault type 100002 pertaining to table mytable and fault type 100035 pertaining to syslogs:
sp_dbcc_exclusions my_db, 'add', 'combo', ‘mytable:100002, syslogs:100035’
Removes fault type 100036 from the exclusion list corresponding to my_db:
sp_dbcc_exclusions my_db, 'drop', 'faults', '100036'
Displays the exclusion list corresponding to my_db:
sp_dbcc_exclusions my_db
Displays the recorded exclusions for all databases:
sp_dbcc_exclusions null, 'listall'
dbname must be null when listall is specified. If op is null, sp_dbcc_exclusions lists the recorded exclusions for the specified database.
Only a System Administrator or the Database Owner can run sp_dbcc_exclusions with a dbname parameter that is not null.
If the dbname and op parameters are null, the user must either be a System Administrator or own at least one of the databases for which exclusions have been recorded.
If the dbname parameter is null and the op parameter is listall, the user must either be a System Administrator or own at least one of the databases for which exclusions have been recorded. If the user is not a System Administrator, only the recorded exclusions for databases owned by the user will be reported.
Only a System Administrator can run sp_dbcc_exclusions without restriction.