1. 查看当前的连接
SELECT conn.session_id, host_name, program_name, nt_domain, login_name, connect_time, last_request_end_time FROM sys.dm_exec_sessions AS sess JOIN sys.dm_exec_connections AS conn ON sess.session_id = conn.session_id;
2. 断掉当前的连接
KILL [Session_ID]
3. 查看当前的未完成的事务
select * from sys.dm_tran_session_transactions where is_user_transaction=1;