Deletes all database files associated with a database.
DROP DATABASE database-name [ KEY key ]
The DROP DATABASE statement physically deletes all associated database files from disk. If the database file does not exist, or is not in a suitable condition for the database to be started, an error is generated.
DROP DATABASE cannot be used in stored procedures, triggers, events, or batches.
The database to be dropped must not be running when the DROP DATABASE statement is used. You cannot be connected to the database you are dropping. You must be connected to a different database. For example, connect to the utility database.
You must specify a key to drop a strongly encrypted database. The key can be either a string (constant literal) or a variable reference.
Your ability to execute this statement depends on the setting for the -gu database option, and whether you have the SERVER OPERATOR system privilege.
In addition to deleting the database files from disk, any associated transaction log file or transaction log mirror file is deleted.
Not in the standard.
Execute the following statement to drop the database temp.db:
DROP DATABASE 'c:\temp\temp.db';
DROP DATABASE 'temp.db' KEY 'mykey';
DROP DATABASE 'temp.db' KEY mykeyvar;