时间:2021-07-01 10:21:17 帮助过:2人阅读
set transaction isolation level read uncommitted
select es.session_id
,es.login_name
,es.host_name
,est.text
,cn.last_read
,cn.last_write
,es.program_name
from sys.dm_exec_sessions es
inner join sys.dm_tran_session_transactions st --系统里还存在的事务
on es.session_id = st.session_id
inner join sys.dm_exec_connections cn on es.session_id = cn.session_id
cross apply sys.dm_exec_sql_text(cn.most_recent_sql_handle) est
left outer join sys.dm_exec_requests er on st.session_id = er.session_id
and er.session_id is null
然后直接Kill ‘session_id’就可以回滚这个事务了
MS SQL 查询未提交的事务和执行的SQL语句
标签:write and out ted log 回滚 gpo nsa 事务