I need a little help to understand why my trigger is not working correctly. Basically my trigger should insert 1 row into 1 table and another 2 rows into a second table. (2 INSERT statements)
When testing, I can see 1 row in TableTarget1 and 1 row in TableTarget2 (from the first INSERT). I do not catch any errors ...
I have the following logic in my trigger:
INSERT INTO TableTarget1 Select(v1, v2, v3) FROM inserted
INSERT INTO TableTarget2 Select(v1, v5, v6) FROM inserted
INSERT INTO TableTarget2 Select(v1, v5, v7) FROM inserted
-- send email to admin
exec msdb.dbo.sp_send_DBMail ...