anyone know sql? i need to disconnect users

Soldato
Joined
5 Jun 2005
Posts
20,890
Location
Southampton
im trying to upgrade a database remotely and some silly bugger is logged in. i have a tool that we use for this purpose however its not working, i need to kill the connections to the database but cant seem to see it.

using sql standard 2008
 
May be better posting this in HTML, Graphics & Programming, those guys know their SQL.
 
Right click the database and go to properties. Then go to the options section and at the bottom set restrict access to single_user; it'll kill all connections apart from yours. Set it back to multi_user when you're all done (if it doesn't do it automatically).
 
Right click the database and go to properties. Then go to the options section and at the bottom set restrict access to single_user; it'll kill all connections apart from yours. Set it back to multi_user when you're all done (if it doesn't do it automatically).

thank you. is this in Studio management?
 
By the way you can view a list of connections by running:
exec sp_who2

most of the 'sa' users will be SQL its self rather than people on your system.

You can kill a specific session by running:
kill <spid> (which you can read from the first column of sp_who2)
 
Back
Top Bottom