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 12»»

SQL Code to Kill Stale Processes Expand / Collapse
Author
Message
Posted Friday, August 23, 2013 9:30 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: Tuesday, August 12, 2014 2:35 PM
Points: 975, Visits: 3,350
Happy Friday Everyone
I am working on some things today. I was thinking it would be good to kill all the stale connections that are over a certain age. I am not sure how to go about this however. I used to have some code that would do this, but I cannot find it. Can anyone assist me in finding the code to perform this task?

Thank you in advance for all your assistance, suggestions and comments

Andrew SQLDBA
Post #1487880
Posted Friday, August 23, 2013 9:34 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:52 PM
Points: 42,849, Visits: 35,978
Why?

What problems are they causing?
Do you know what they were doing?
Do you know if the applications can handle a terminated connection?



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1487888
Posted Friday, August 23, 2013 9:39 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 9:31 AM
Points: 3,910, Visits: 7,138
There's a good post by Dave Smith below:
http://forums.databasejournal.com/showthread.php?3090.html

I think this will help with what you need


______________________________________________________________________________
"Never argue with an idiot; They'll drag you down to their level and beat you with experience"
Post #1487891
Posted Friday, August 23, 2013 9:39 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: Tuesday, August 12, 2014 2:35 PM
Points: 975, Visits: 3,350
Hey Gila
The application is not closing them. I need to kill them if they are a couple days old. Also, there are some users that connect using SSMS that leave it open after not logging out correctly.

Thanks
Andrew
Post #1487892
Posted Friday, August 23, 2013 9:54 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:52 PM
Points: 42,849, Visits: 35,978
AndrewSQLDBA (8/23/2013)
Hey Gila
The application is not closing them. I need to kill them if they are a couple days old.


Why? What problem are they causing? What effect will it have on the app if you do?




Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1487903
Posted Friday, August 23, 2013 10:02 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: Tuesday, August 12, 2014 2:35 PM
Points: 975, Visits: 3,350
It will not affect the app at all.

Andrew
Post #1487908
Posted Friday, August 23, 2013 10:06 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 1:03 PM
Points: 3,154, Visits: 8,022

So why close them?




Alvin Ramard
Memphis PASS Chapter

All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.
Post #1487911
Posted Friday, August 23, 2013 10:15 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: Tuesday, August 12, 2014 2:35 PM
Points: 975, Visits: 3,350
There are some users that connect using SSMS that leave it open after not logging out of the remote session correctly. That is the biggest thing I want to kill

Andrew SQLDBA
Post #1487915
Posted Friday, August 23, 2013 10:22 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 1:03 PM
Points: 3,154, Visits: 8,022

Why do you want to kill those? Why bother?




Alvin Ramard
Memphis PASS Chapter

All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.
Post #1487921
Posted Friday, August 23, 2013 10:47 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: Tuesday, August 12, 2014 2:35 PM
Points: 975, Visits: 3,350
Why would I not want too? They are taking up memory and cpu

Andrew
Post #1487929
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse