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
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.
sp_dbcc_exclusions null, 'add', 'tables', 'syslogs, syscomments'
sp_dbcc_exclusions my_db, 'add', 'faults', '100036'
sp_dbcc_exclusions my_db, 'add', 'combo', ‘mytable:100002, syslogs:100035’
sp_dbcc_exclusions my_db, 'drop', 'faults', '100036'
sp_dbcc_exclusions my_db
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 are reported.
The permission checks for sp_dbcc_exclusions differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be the database owner of dbccdb (or dbccalt), or have the manage checkstorage privilege on the specified database. |
Disabled | With granular permissions disabled, you must be a user with sa_role. |