Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
Removes a database and all files associated with that database.
Important
This feature will be removed in a future version of 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.
Transact-SQL syntax conventions
sp_dbremove
[ [ @dbname = ] N'dbname' ]
[ , [ @dropdev = ] 'dropdev' ]
[ ; ]
The name of the database to be removed. @dbname is sysname, with a default of NULL
.
A flag provided for backward compatibility only and is currently ignored. @dropdev is varchar(10), with a default of dropdev
.
0
(success) or 1
(failure).
None.
Requires membership in the sysadmin fixed server role, or execute permission directly on this stored procedure.
The following example removes a database named sales
and all files associated with it.
EXEC sp_dbremove sales;
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today