select request_session_id as id,OBJECT_NAME(resource_associated_entity_id) as tablename from sys.dm_tran_lockswhere resource_type=’OBJECT’

kill id 例如:kill 58
------------------------

鎖測試:
begin tran
select * from brand with (TABLOCKX)
raiserror ('dd',16,1)
commit tran

------------------------

raiserror不會自動回滾,要配合try,,catch使用。[11,19],则跳到catch

begin tran
update brand set des1='222' where brand='00'
select * from brand with (TABLOCKX)
raiserror ('dd',16,1)
commit tran

select * from brand

update brand set des1='111' where brand='00'

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-12-27
  • 2021-11-29
  • 2022-01-15
  • 2022-01-03
相关资源
相似解决方案