sp_dbcc_deletedb

Deletes from dbccdb all the information related to the specified target database.

Syntax

sp_dbcc_deletedb [dbname | dbid]

Parameters

Examples

Usage

There are additional considerations when using sp_dbcc_deletedb:
  • sp_dbcc_deletedb deletes from dbccdb all the information related to the specified target database, including configuration information and the results of previous dbcc checkstorage operations.

  • If the deleted database is dbccdb, and the dbccalt database exists, sp_dbcc_deletedb deletes the configuration information and results of dbccdb from dbccalt.

  • To remove the results of dbcc checkstorage operations created before a specific date, use sp_dbcc_deletehistory.

  • Using the dbid option is the only way to delete the contents of the dbccdb database for a database that has already been dropped.

See also:
  • dbcc in Reference Manual: Commands

  • System Administration Guide for information about the dbccalt database.

Permissions

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

SettingDescription
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 the database owner of the specified database or have sa_role to run sp_dbcc_deletedb.

Related reference
sp_dbcc_deletehistory
sp_dbcc_evaluatedb
sp_plan_dbccdb