Important Points About SQL DROP DATABASE Statement
- Deleting a Database: Deleting a database is a permanent action and will result in the loss of all information stored in the database.
- Backup: Make sure you have taken proper backup of the database before you delete it.
- Privileges: Make sure you have the necessary privilege to delete the database. Usually an admin can delete the database.
- Database State: A database can be dropped regardless of its state: offline, read-only, suspect, and so on.
- Database Snapshots: Dropping a database snapshot deletes the database snapshot from an instance of SQL Server and deletes the physical NTFS File System sparse files used by the snapshot.
- Replication: To drop a database published for transactional replication, or published or subscribed to merge replication, you must first remove replication from the database.
- System Databases: System databases cannot be dropped
SQL DROP DATABASE
SQL DROP DATABASE statement deletes an existing database from the system, and once deleted, users can not retrieve that database.
The DROP DATABASE command in SQL deletes the database along with its data, like tables, views, indexes, constraints, and properties like permissions and schemas.