终止活跃交易 [英] To Kill Active Transactions

查看:71
本文介绍了终止活跃交易的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想在Sql Server 2005中执行以下操作.
1连接到当前数据库
2运行整个数据库,查找是否有任何活动事务
3收集所有活动的事务
4 Kill-回滚所有交易
5锁应用于哪个表?
6谁是通过
完成锁定的用户

请提出一个解决方案.
在此先感谢您.

Hi
I want to perform the following in Sql server 2005 .
1 Connect to the Current database
2 Run though the whole database and find if there are any active transaction
3 Collect all the transaction that are active
4 Kill - Rollback all the transactions
5 Which table the lock is applied?
6 Who is the user that the lock is done by


Kindly suggest a Solution .
Thanks in advance .

推荐答案

谢谢您的提问.您可以通过语法如下的SQL语句来检查数据库中的活动事务.

Thank you for your question. You can check active transaction in a database by the following SQL Statement that syntax is.

DBCC OPENTRAN
[
    ( [ database_name | database_id | 0 ] ) ]
    { [ WITH TABLERESULTS ]
      [ , [ NO_INFOMSGS ] ]
    }
]



您将获得SPID(服务器进程ID).然后使用Kill终止它.



You will get SPID (server process ID). Then use Kill to terminate it.

KILL { session ID | UOW } [ WITH STATUSONLY ]




谢谢,
马蒙




Thanks,
Mamun


这篇关于终止活跃交易的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆