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

Killing User Connection(session) connected to the Database. Expand / Collapse
Author
Message
Posted Friday, April 8, 2011 12:17 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: Friday, August 29, 2014 10:11 AM
Points: 831, Visits: 1,376
Comments posted to this topic are about the item Killing User Connection(session) connected to the Database.

Thanks.
Post #1090417
Posted Friday, April 8, 2011 7:10 AM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Friday, August 30, 2013 8:57 AM
Points: 115, Visits: 74
If your application or access to the database doesn't use dbo or sa authority you can just use:

ALTER DATABASE db_name SET RESTRICTED_USER With ROLLBACK IMMEDIATE

This will drop all user connections and rollback any non-committed transactions. When RESTRICTED_USER is specified, only members of the db_owner, dbcreator, or sysadmin roles can use the database.

We use this to restrict access to a system so we can backup Production databases prior to a deployment.



Post #1090593
Posted Monday, April 18, 2011 10:45 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 14, 2014 3:13 PM
Points: 8, Visits: 258
Hi Sourav,

You've marked this as being compatible with SQL Scripts Manager (http://www.red-gate.com/products/dba/sql-scripts-manager/), but I don't think it is. Are you able to edit it to correct this?

Thanks,


Colin.
Post #1095150
Posted Monday, April 18, 2011 2:09 PM


SSC Eights!

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

Group: General Forum Members
Last Login: Friday, August 29, 2014 10:11 AM
Points: 831, Visits: 1,376
Sorry, couldn't get the hyperlink. Could you please suggest where you can see the interlink?

Thanks.
Post #1095289
Posted Monday, April 18, 2011 4:44 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 14, 2014 3:13 PM
Points: 8, Visits: 258
Sorry, I wasn't clear in my previous post. When you created your post at http://www.sqlservercentral.com/Contributions/New/Script, I believe you ticked the box to "Include code for SQL Scripts Manager", and then you pasted your T-SQL script into the box that's supposed to contain the XML-wrapped script that runs within the SQL Scripts Manager tool; whereas you needed to paste your code into the box entitled "Insert your SQL code here".

So your script is now showing up at http://www.sqlservercentral.com/Scripts/rgtool/, which is a list of scripts that have been wrapped up in the XML format that allows them to run within SQL Scripts Manager.

Are you able to edit your contribution, to remove the SQL Scripts Manager content?

Best regards,


Colin.
Post #1095359
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse