November 2, 2009 at 10:06 pm
Dear All,
We have a software product for POS, The Products is used by over 300 machine in all over the country,
Here we need to kill process id, Which is idle above 10 min with out "sa" user id , Can any one send me the solutions,
' My Attempt is ,
Procedures for killing
sheduling the jobs for every one min...
But my procedures is not working..'
November 2, 2009 at 10:41 pm
1. Which Version of SQL Server you are using?
2. Are you sure you do not have any slow running query in your system?
3. If 2 is correct then what is value for program name when you run sp_who2?
[font="Verdana"]--www.sqlvillage.com[/size][/font]
November 2, 2009 at 11:17 pm
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 5.1 (Build 2600: Service Pack 3)
anyhow Thanks for post,
I done that with the help of sys.DM_EXEC_SESSIONS tables
and job shedule...
November 3, 2009 at 8:10 am
Automatic kill can be a death sentence especially when the rollback kicks in. I would personally go a different route to figure out why this spid is staying active longer than desired than just running around the data tier with a sawed off shotgun wacking spids.
EDIT:
Noticed you say inactive, this may not necessary be a bad thing as it could just be a connection sitting in the pool ready for reuse.
November 3, 2009 at 8:19 am
einman33 (11/3/2009)
Automatic kill can be a death sentence especially when the rollback kicks in. I would personally go a different route to figure out why this spid is staying active longer than desired than just running around the data tier with a sawed off shotgun wacking spids.EDIT:
Noticed you say inactive, this may not necessary be a bad thing as it could just be a connection sitting in the pool ready for reuse.
do not kill connections unless you have a very specific reason for doing so...it sounds like you looked at the DMV and decided "aw they don't need to be connected, they are not doing anything"
I'm on the same page as einman; the spids could simply be connection pooling, and idle connections are not an issue, anyway.
unless you KNOW those idle spids are causing blocking trouble(which would imply an application that needs to be fixed) , you should never try to kill them. you may end up creating problems for users because they would have no idea you are deleting their connections, and all of the sudden they need to restart their app all the time...would the IT department KNOW you are killing spids for unknown reasons?
Lowell
November 3, 2009 at 8:21 am
As discussed in the similar thread a few days ago, there may be a better solution. Discussing WHY you want to kill the spid, may lead to new ideas.
April 16, 2015 at 12:29 am
Hi.. This can be done by creating T-SQL by running using batch file..
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply