Removes one or more databases from Microsoft® SQL Server™. Removing a database deletes the database and the disk files used by the database.
DROP DATABASE database_name [,...n]
The database context of the connection must be in the master database to use DROP DATABASE.
In SQL Server version 7.0, DROP DATABASE removes damaged databases that have been marked suspect. DROP DATABASE removes the specified database unless it has been marked OFFLINE.
A database that has been dropped can be re-created only by restoring a backup. You cannot drop a database currently in use (open for reading or writing by any user). Whenever a database is dropped, the master database should be backed up .
DROP DATABASE permission defaults to the database owner and members of the sysadmin fixed server role, and is not transferable.
This example removes all references for the publishing database from the system tables.
DROP DATABASE publishing
This example removes all references for each of the listed databases from the system tables.
DROP DATABASE pubs, newpubs
ALTER DATABASE | sp_renamedb |
CREATE DATABASE | USE |
sp_helpdb | sp_dropdevice |