USE db_to_restore
Add that's already the cause, you self be connected to the database and so it is in use.
Use
USE master
to be connected to the system database, not to the user DB.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dear all,
How to resolve it below?
Exclusive access could not be obtained because the database is in use.
I ran the following
USE db_to_restore
go
ALTER DATABASE db_to_restore SET SINGLE_USER WITH ROLLBACK IMMEDIATE
go
but it did not help.
USE db_to_restore
Add that's already the cause, you self be connected to the database and so it is in use.
Use
USE master
to be connected to the system database, not to the user DB.