Find and Kill SQL Server orphaned transactions


select * from sys.sysprocesses where status = 'SLEEPING' and open_tran > 0


-------
declare @sp int
select @sp = spid from sys.sysprocesses where status = 'SLEEPING' and open_tran > 0


if @sp is not null
begin
    declare @tempString nvarchar (255)
    set @tempString = 'kill ' + cast (@sp as varchar (5))
    exec sp_executesql @tempString
end