... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2007-11-01

SQL Server: Offline vs DROP DATABASE

If you issue the command DROP DATABASE for a SQL Server database that is offline, the associated MDF and LDF files will not be deleted.

In a related note, if you take a database offline using

sp_dboption 'mydb','offline','true'

you may get this error message when you attempt to bring it online:

Device activation error.  The physical file name 'c:\blah\mydb.ldf' may be incorrect.

Use the following command instead:

alter database mydb set offline with rollback immediate

The former appears does not appear to offline the database files cleanly.

Blog Archive