SSMS in general uses several connections to the database behind the scenes.
You will need to kill these connections before changing the access mode.
First, make sure the object explorer is pointed to a system database like master.
Second, execute a sp_who2 and find all the connections to database 'my_db'. Kill all the connections by doing
KILL { session id }
where session id is the SPID
listed by sp_who2
.
Third, open a new query window.
Execute the following code:
-- Start in master
USE MASTER;
-- Add users
ALTER DATABASE [my_db] SET MULTI_USER
GO
No comments:
Post a Comment