I posted a similar question earlier - but can\'t seem to get a long enough response! Sorry if I shouldn\'t be posting again!
This is using SQL Server 2008. I have a tabl
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
Note that this will handle more than one row being inserted by a single statement.