I have a table where rows are created via a stored procedure.
I need a trigger that will then insert those rows into another table.
The problem I am having is that it seems to be trying to insert the rows before the row is established in the first table. When the trigger below executes I get an error stating that the table does not except nulls into num_of_copies_num (which is correct)
This makes it seems to be that it is trying to do the insert before the row has been created by the sproc. Any advice?
create trigger [dbo].[insert_transcript_request]
AFTER INSERT, UPDATE
AS if UPDATE(id_num)
insert into TRANSCRIPT_REQUEST(ID_NUM,
isnull(tr_seq.old_seq,0) + 1,
'request from trigger', GETDATE(), 'SA_nag'
FROM inserted i , (select MAX(SEQ_NUM_2) as old_seq
from TRANSCRIPT_REQUEST t, inserted i
where t.ID_NUM = i.id_num) as tr_seq
where ID_NUM is not NULL