Killing User Connection(session) connected to the Database.

  • Comments posted to this topic are about the item Killing User Connection(session) connected to the Database.

    Thanks.

  • 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.:-)

  • Hi Sourav,

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

    Thanks,

    Colin.

  • Sorry, couldn't get the hyperlink. Could you please suggest where you can see the interlink?

    Thanks.

  • 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/[/url], 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.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply