declare @int int
DECLARE auth_cur CURSOR FOR
select distinct
request_session_id spid
--,OBJECT_NAME(resource_associated_entity_id) tableName
from
sys.dm_tran_locks
where
resource_type='OBJECT'
open auth_cur
fetch next from auth_cur into @int
while (@@fetch_status=0)
BEGIN
exec('kill '+@int)
fetch next from auth_cur into @int
END
close auth_cur
deallocate auth_cur