DCSIMG
MS-SQL: Changing single user Database to multi users - Gilad Lavian's Blog

Gilad Lavian's Blog

In Development

MS-SQL: Changing single user Database to multi users

The problem:

Changes to the state or options of database "DatabaseName" cannot be made at this time. The database is in single-user mode, and a user is currently connected to it.

 

The solutions:

use master
go

alter database "DatabaseName" set multi_user;

 

If there's users connected to the Database and you don't know who, you can use "sp_who2" to check who's connected.

 

You can kill only user process by there SPID:

kill 15;

תוכן התגובה

Yoann. B כתב/ה:

Nice tip!

Thanks.

# December 7, 2008 8:06 PM
שלח תגובה

(שדה חובה)  

(שדה חובה)  

(אופציונלי)

(שדה חובה) 

Please add 8 and 1 and type the answer here:


Enter the numbers above: