PRB: sp_detach_db Message Incorrectly Implies That it Drops Database (281912)
The information in this article applies to:
This article was previously published under Q281912 SYMPTOMS
In SQL Server 7.0 Query Analyzer, if you attempt to detach a database that is in use, the informational message output that appears is misleading:
Server: Msg 3702, Level 16, State 1, Line 0
Cannot drop the database '<DB_NAME>' because it is currently in use.
The message contains the phrase "drop the database", which may cause you to assume that the database will be removed and all data lost. In SQL Server 7.0 Books Online, in the "DROP DATABASE (T-SQL)" topic, the following is stated:
Removes one or more databases from Microsoft SQL Server. Removing a database deletes the database and the disk files used by the database.
WORKAROUND
Ignore the message that refers to the database being dropped. The sp_detach_db system stored procedure removes the specified database entries from the system tables; the database itself is not actually deleted, nor are the underlying .mdf and .ldf files actually deleted.
Modification Type: | Major | Last Reviewed: | 12/29/2000 |
---|
Keywords: | kbDSupport kbprb KB281912 |
---|
|