I am working with a trigger. that responds to an update value.
Once the table has been updated, i want to be able to delete the value, since
1. the trigger would insert new values into other tables
2. The updated table would be of no use.
Currently i am using this script below, but i am being adviced that using intermediate variables might return errors, esp. If there are more than one row updated
CREATE TRIGGER [PO_AGREEMENT_UPDATE] ON [dbo].[e_invoice]
IF UPDATE (STATUS)
declare @order2invoice int
select @order2invoice = (select invoice_num from inserted where usr = @user)
--i have edited the code, but some scripts will be executed here
delete from e_invoice where invoice_num = @order2invoice