Export (0) Print
Expand All
Expand Minimize
0 out of 1 rated this helpful - Rate this topic

sp_dbremove (Transact-SQL)

Removes a database and all files associated with that database.

ms187980.note(en-US,SQL.90).gifImportant:
This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. We recommend that you use DROP DATABASE instead.

Topic link icon Transact-SQL Syntax Conventions


sp_dbremove [ @dbname = ] 'database' [ , [ @dropdev = ] 'dropdev' ] 
[ @dbname = ] 'database'

Is the name of the database to be removed. database is sysname, with a default value of NULL.

[ @dropdev = ] 'dropdev'

Is a flag provided for backward compatibility only and is currently ignored. dropdev has the value dropdev.

0 (success) or 1 (failure)

Requires membership in the sysadmin fixed server role.

The following example removes a database named sales and all files associated with it.

EXEC sp_dbremove sales;
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.