Deletes from dbccdb all the information related to the specified target database.
sp_dbcc_deletedb [dbname | dbid]
sp_dbcc_deletedb "engdb"
All information for database engdb has been deleted from dbccdb.
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.
dbcc in Reference Manual: Commands
System Administration Guide for information about the dbccalt database.
The permission checks for sp_dbcc_deletedb 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 the database owner of the specified database or have sa_role to run sp_dbcc_deletedb. |