TipsOnLips.net

Your .net tips and tricks source

About the author

Author Name is someone.
E-mail me Send mail

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010


Kill All Blocked Transactions On SQL Server

--Kill All Blocked Transactions

use master

DECLARE @pid varchar(255)

DECLARE MY_CURSOR Cursor FOR

select distinct req_transactionUOW

from syslockinfo

WHERE req_spid=-2 and req_transactionUOW <> '00000000-0000-0000-0000-000000000000'

OPEN MY_CURSOR

FETCH FROM MY_CURSOR

INTO @pid

WHILE @@FETCH_STATUS = 0

BEGIN

 

PRINT 'KILL ''' + @pid + ''''

exec ('KILL ''' + @pid + '''')

FETCH FROM MY_CURSOR

INTO @pid

END

CLOSE MY_CURSOR

DEALLOCATE MY_CURSOR


Categories: SQL Server
Posted by developer on Monday, February 23, 2009 7:26 AM
Permalink | Comments (5) | Post RSSRSS comment feed

Comments

tx weight loss doctors in texas United States

Monday, November 09, 2009 12:15 PM

tx weight loss doctors in texas

I posted your blog to my facebook group


Regards
nulop

Interpreters London United States

Thursday, November 12, 2009 7:38 PM

Interpreters London

I added your post to my college Report


Regards
Vickers

washington state divorce attorney United States

Friday, November 13, 2009 1:13 PM

washington state divorce attorney

Hi nice site design


Regards
mani

john wayne books United States

Friday, November 20, 2009 9:00 PM

john wayne books

I often read your blog and always find it very interesting. Thought it was about time i let you knowKeep up the great work



Regards
Crak

paydayloans United States

Thursday, December 17, 2009 11:57 PM

paydayloans

Interesting ... as always - is your blog making any cash advance ? ;)

Add comment


(Will show your Gravatar icon)

  Country flag


Loading