create PROCEDURE [dbo].[ApproveOrder]
@order_no int
AS
declare @status as char(2) select @status=status from Advorders where order_no = @order_no
if @status = 'PA' or @status = 'XX'
begin
update Advorders set status = 'OP', dirty = 1 where order_no = @order_no
end
@order_no int
AS
declare @status as char(2) select @status=status from Advorders where order_no = @order_no
if @status = 'PA' or @status = 'XX'
begin
update Advorders set status = 'OP', dirty = 1 where order_no = @order_no
end
AS
declare status1 as char(2);
select status into status1 from Advorders where order_no = order_no1;
if status1 = 'PA' or status = 'XX' then
update Advorders set status = 'OP', dirty = 1 where order_no = order_no1;
end if;
end