Link to home
Start Free TrialLog in
Avatar of Member_2_4344952
Member_2_4344952

asked on

SQL server login issue

Logged in using single user mode
Avatar of David Sankovsky
David Sankovsky
Flag of Israel image

OK... What is the error?
Are you trying to log into SQL management studio or connect a user to the DB to run operations?

is it a problem with a specific user or all local users?

You gave us no information to work with, Please explain your problem with as much information as you can, any debugging steps you took should be listed as well

You can acquire SINGLE_USER mode against a database by running SQL code like below however you may need to review the ROLLBACK IMMEDIATE option if it is not appropriate for your need plus if you close the SSMS session where you run this before the database is switched back to MULTI_USER then some other session may use it exclusively until you open new session and run the SET MULTI_USER. Highlight all the code below in SSMS and execute so it all goes in one.

USE [master]
ALTER DATABASE YourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
-- put all your SQL commands here like a RESTORE DATABASE...for instance
ALTER DATABASE YourDBname SET MULTI_USER
GO

Open in new window

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.