Saturday, June 6, 2020

Database '*********Database Name*******' is already open and can only have one user at a time

When i was trying to restore database on SQL Server, after some time database restore got failed cause of insufficient space in drive. When i changed my mind and decide not to restore database. I click on "New Query" button to start SQL query window. what i observed it got connect to master database instead of my database on which i want to write SQL query.

Second thing i observed, my database entered in single user mode, it appear on left pane window as "Database Name (Single User)"

How to Fix this:

Execute below query after connecting to SQL Server on any database 

ALTER DATABASE DatabaseName SET MULTI_USER WITH ROLLBACK IMMEDIATE;

Your problem will get resolved and you will be able to execute query on your database.


No comments:

Post a Comment

web stats