This is my first attempt at an INSERT AFTER trigger. What I need to happen is if the transactions are coming from timesheets(SOURDOC='PATS') I need to replace the employee ID(ORMSTRID) with another value that is held in a user defined field on the employee card(UPR00100). In the GL20000 table the jrnentry field is the primary key. This trigger appears to work but do I need to add anything to it for data validation?
create trigger [dbo].[ORMSTRID] on [dbo].[GL20000] after insert
FROM dbo.GL20000 T1
INNER JOIN dbo.UPR00100 T2 ON T1.ORMSTRID=T2.EMPLOYID
INNER JOIN inserted ins on T1.JRNENTRY=ins.JRNENTRY