在事务中可用select语句吗,会不会出现死锁?
begin transaction
begin try
declare @total_q
--统计PO收货情况
select @total_q=sum(total_q) from tb_grn where pono=@pono
--如果没有收货,则可删PO
if @total_q=0
begin
delete tb_pono_hdr where pono=@pono
delete tb_pono_det where pono=@pono
set @execute=1
end
else
begin
set @execute=0
end
commit transaction
end try
begin catch
set @execute=0
rollback tran
end catch