用事务控制:declare @plh varchar(11)
begin transaction t
--生成临时表(注意排序条件)
select xxx=identity(int,1,1),* into #tmp_splsk  from splsk  order by rq--加个自增列
--计算plh
update #tmp_splsk set plh='Z'+right('00000000000'+cast(id as varchar),11)--根据自增列更新
alter table #tmp_splsk drop column xxx--删除自增列
--更新到splsk表
truncate table splsk--这个比delete快
insert into splsk 
  select *  from #tmp_splsk  order by plh
--同步更新maxbhz
select @plh=max(plh)  from splsk 
update maxbhz  set maxbh=@plh  where biaoshi='Z'
--删除临时表
drop table #tmp_splsk
commit transaction t