--放到一个事务处理,事务处理完成后,自动释放锁
begin tran
--更新处理
update a set a='x' from ta a  WITH (XLOCK)
update b set a='x' from tb b  WITH (XLOCK)
commit tran