create trigger [dbo].[test] on [dbo].[invoice]
for insert
as
begin
update Invoice
set Trader_Status = 'OPEN'
where Invoice_Id in ( select Invoice_Id from inserted where Invoice_Status = 'PENDING' )
update Invoice
set Trader_Status = 'BLOCKED'
where Invoice_Id in ( select Invoice_Id from inserted where Invoice_Status = 'OVERDUE' )
end
ध्यान दें कि यह एक से अधिक पंक्तियों को एक कथन द्वारा सम्मिलित किए जाने को संभालेगा।