mannaggia (2/15/2011)
I just do this:
ALTER DATABASE dbname
SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE dbname
SET MULTI_USER
GO
Any advantage or disadvantage over the script?
This works easier for me. The only reason to kill all the spids usually anyway is to put the database into another mode besides multi_user. 😀
"Technology is a weird thing. It brings you great gifts with one hand, and it stabs you in the back with the other. ...:-D"