I am trying to have a trigger fire when the Merge agent inserts or deletes data into / from a table. It is supposed to insert data into a report table for use with SSRS.
I DO NOT have the "NOT FOR REPLICATION" set in the trigger. Here is the trigger code:
ALTER TRIGGER [dbo].[MyTable_INSERT]
ON [dbo].[MyTable]
FOR INSERT
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO...
END
I have tried FOR INSERT
and AFTER INSERT
, neither seem to work.
The table structure is usual parent / child, I have the trigger set on the child to make sure the parent is already created. The relationships are secured with FK's.
I'm sure am overlooking something simple. Any ideas ?
AFTER INSERT
. Check this msdn blog for more info.FOR INSERT
=AFTER INSERT
in Transact-SQL.