April 12, 2015 at 6:04 am
Hi All,
I have one application running on sqlserver , i need if the user not using the application sqlserver kill the session of the user?
April 12, 2015 at 8:12 am
Better would be to have a timeout on the application side. If you kill the connections, you could see data loss.
But, you can look at sys.dm_exec_connections to see the connection time and the last read and last write. If you really want to find connections not doing anything, that's probably a good way to go about it. You'll need to use a cursor to kill the idle connections. You can query this every 10 minutes or so and clear out connections that don't have activity in the last 30 pretty easily.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 12, 2015 at 10:49 am
farrukhhameed786 (4/12/2015)
Hi All,I have one application running on sqlserver , i need if the user not using the application sqlserver kill the session of the user?
Quick question, why?
I agree with Grant, this is better handled on the application side. It is not uncommon to see heavy operations accumulate hours of wait on a busy system, cutting one of those off could be catastrophic!
😎
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply