Deleting a Database

A database can be deleted via SQL Sever Management Studio, or via the DROP DATABASE command. Listed below are some important points to consider when dropping a database:

  • A database cannot be deleted if it is in use.

  • Dropping a database deletes the database from an instance of SQL Server and deletes the physical disk files used by the database. The only exception is when the database or any one of the files is offline. In this case, the disk files are not deleted and must be deleted manually from the file system.

  • A database can be deleted regardless of its state: offline, read-only, suspect, and so on. However, once deleted it can be re-created only by restoring a backup.

  • Only users having CONTROL permission on the database can ...

Get Microsoft® SQL Server™ 2005 Administrator's Companion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.