Collections:
Database in Use When Dropping a Database in SQL Server
Why I am getting this error when dropping a database in SQL Server?
✍: FYIcenter.com
If you are trying to drop a database that is in use, you will get an error message like this: 'Cannot drop database "FyiCenterData" because it is currently in use.'
Before dropping a database, you must stop all client sessions using this database. If your own client session is using this database, you should set a different database as the current database as shown in this tutorial example:
CREATE DATABASE FyiCenterData GO USE FyiCenterData GO DROP DATABASE FyiCenterData GO Msg 3702, Level 16, State 4, Server LOCALHOST\SQLEXPRESS Cannot drop database "FyiCenterData" because it is currently in use. USE master GO DROP DATABASE FyiCenterData GO
⇒ Getting a List of All Databases on the Server in SQL Server
⇐ "DROP DATABASE" - Deleting Databases in SQL Server
2016-11-24, 2575🔥, 0💬
Popular Posts:
How To End a Stored Procedure Properly in SQL Server Transact-SQL? Where the end of the "CREATE PROC...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...
How To Insert New Line Characters into Strings in SQL Server Transact-SQL? If you want to break a st...
Can You Drop an Index Associated with a Unique or Primary Key Constraint in Oracle? You can not dele...
How To Connect ASP Pages to Oracle Servers in Oracle? If you are running Windows IIS Web server and ...