November 10, 2008 at 4:01 am
Is there any way to make script, which find oldest open transaction and kill those oldest Process.
I have tried dbcc opentran, but from that i can not got opuput into another table, otherwise i can kill those process...Please give me a script or TSQL to kill oldest open transaction.
Please needfull to me..
Thanks
November 10, 2008 at 5:59 am
Not sure what exactly you want to kill. If your looking for old processes which are no longer active, you can use the sys.processes table or in SQL 2005 the DMV sys.dm_exec_sessions.
If it's open transactions your looking for you could use DBCC OPENTRAN WITH TABLERESULTS to insert the results into a tablevariable.
But again the recommended way in SQL 2005 would be using the DMV sys.dm_tran_active_transactions or sys.dm_tran_database_transactions.
[font="Verdana"]Markus Bohse[/font]
November 10, 2008 at 10:20 pm
Paresh Prajapati (11/10/2008)
Is there any way to make script, which find oldest open transaction and kill those oldest Process.I have tried dbcc opentran, but from that i can not got opuput into another table, otherwise i can kill those process...Please give me a script or TSQL to kill oldest open transaction.
Please needfull to me..
Thanks
killing transactions means what
is it
cancelling
closing
committing
rollbacking
kshitij kumar
kshitij@krayknot.com
www.krayknot.com
November 12, 2008 at 2:41 am
Thanks guys
I got oldest active transactions which are remain to close from DMV which u have given.
Now I am able to kill or rollback those transactions.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply