当前位置: 代码迷 >> ASP.NET >> sql锁表解表,该如何解决
  详细解决方案

sql锁表解表,该如何解决

热度:1261   发布时间:2013-02-25 00:00:00.0
sql锁表解表
求一个sql server锁表和解表操作,我菜鸟,文章就不用贴了。求动手给个代码

------解决方案--------------------------------------------------------
第一个窗口:
begin tran
select * from table1 with (holdlock)

-- 这里增删改查
DECLARE @i int
set @i=10000000

while(@i>0)
begin
set @i=@i-1
end


commit tran 

第二个窗口:
update table1 set xxxID='0' where mID='0'

  相关解决方案