Hi,
I have the following trigger set up. All its designed to do is after an insert into the PL_TRANSACTION table it copys data from the PT_BATCH_REF field into PT_INTERNAL_REF. However my issue is at present it updates all rows with this information. I want to to only effect the inserted row. I thought the 'from inserted' did this but apparently not. I'm sure this is simple. Thanks
ALTER trigger [dbo].[Internal_Update]
on [dbo].[PL_TRANSACTIONS]
after insert
as
declare
@internalref float
select
@internalref = cast(pt_batch_ref as float)
from inserted
update pl_transactions
set pt_internal_ref = @internalref
I have the following trigger set up. All its designed to do is after an insert into the PL_TRANSACTION table it copys data from the PT_BATCH_REF field into PT_INTERNAL_REF. However my issue is at present it updates all rows with this information. I want to to only effect the inserted row. I thought the 'from inserted' did this but apparently not. I'm sure this is simple. Thanks
ALTER trigger [dbo].[Internal_Update]
on [dbo].[PL_TRANSACTIONS]
after insert
as
declare
@internalref float
select
@internalref = cast(pt_batch_ref as float)
from inserted
update pl_transactions
set pt_internal_ref = @internalref