I have table1 which is being updated and inserted with data via sp’s.
the update is per Id of the row ( not bulk update) – I mean – Single update.
This table has Trigger Tg1 – which updates some fields in the same record that has been updated . ( after the record updated in the db – TG1 update some of her fields)
I DONT HAVE ACCESS to TG1 !.
This table has another trigger which ive build Tg2.
which archive the original inserted record via SELECT * FROM DELETED ... and insert to table Archive...
the problem is that Tg2 catches also the events for TG1 ! ( it inserting to the archive table 3 records insted of 1.
Question : Is there anyway (in TG2) to know that the Action came from Tg1 ? ( so i would be able to avoid those events – since i need only the events which came from my sp.)
How can i solve that ? ( i dont have access to tg1…)
Why would you not want to archive the record as it finally exists in the table?
However, you can set the trigger order on your trigger to be the first one using
sp_settriggerorder. Lookup in Books online how to do that.