Removes a database and all files associated with that database.
Important This procedure is provided for backward compatibility only. For removable media databases, use sp_detach_db to remove a database from the server.
sp_dbremove [@dbname =] 'database' [, [@dropdev =] 'dropdev']
0 (success) or 1 (failure)
None
Execute permissions default to members of the sysadmin fixed server role or db_owner fixed database role for the database for which the drop will be performed.
This example removes a database named sales and all files associated with it.
sp_dbremove sales
ALTER DATABASE | sp_detach_db |
CREATE DATABASE | System Stored Procedures |
DBCC |