Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

usp_KillConnections Expand / Collapse
Author
Message
Posted Sunday, September 30, 2007 4:01 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, December 11, 2013 6:42 AM
Points: 987, Visits: 107
Comments posted to this topic are about the item usp_KillConnections
Post #404641
Posted Friday, October 5, 2007 7:33 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 3:29 PM
Points: 184, Visits: 250
Nice stored procedure to kill processes but I don't understand when you would use it?

If you need everyone out of a database and need them to stay out, then I'd use:
ALTER DATABASE [MyDatabase] SET SINGLE_USER WITH ROLLBACK AFTER n SECONDS
do maintenance tasks here
ALTER DATABASE [MyDatabase] SET MULTI_USER

While the maintenance tasks are running, no one else can connect.

If you need to restrict it to admins only, then use RESTRICTED_USER instead of SINGLE_USER.

Just a thought,
Joe
Post #407338
Posted Friday, October 5, 2007 10:17 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, October 10, 2014 2:23 PM
Points: 51, Visits: 222
For my case, after I kill user connections by using this kind of stored procedure, our application re-connects to database right away. I believe that it is the good choice to put your database in single user mode.


Post #407465
Posted Monday, October 22, 2007 8:59 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Today @ 11:28 AM
Points: 14, Visits: 200
You neglected to include the net send logic.


Post #413453
Posted Wednesday, January 23, 2008 2:23 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Saturday, August 25, 2012 9:48 PM
Points: 777, Visits: 134
hi,
its soo helpful script for me. so simple to run. really appreaciatable.

thx
sreejith
MCAD
Post #446637
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse