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
2016-11-24, 665👍, 0💬
Popular Posts:
Can You Create a View with Data from Multiple Tables in SQL Server? Can You Create a View with Data ...
Where to find answers to frequently asked questions on Conditional Statements and Loops in SQL Serve...
How To Count Rows with the COUNT(*) Function in SQL Server? If you want to count the number of rows,...
What Is Oracle in Oracle? Oracle is a company. Oracle is also a database server, which manages data ...
What is mscorsvw.exe - Process - Microsoft .NET Framework NGEN in SQL Server? Process mscorsvw.exe i...