Hi All,
I need to know if there is any methode to detect within a trigger, that it
was fired because of merge agent update of the table and not because of the
application's update.
Thanks.
query sessionproperty('replication_agent') to see if its value is 0. If so
a replication agent is making the update, if it is 1, it is another user
process.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Oussama Albairat" <OussamaAlbairat@.discussions.microsoft.com> wrote in
message news:990BF6F4-FF7A-4F76-B560-D9A02261FA3D@.microsoft.com...
> Hi All,
> I need to know if there is any methode to detect within a trigger, that
it
> was fired because of merge agent update of the table and not because of
the
> application's update.
> Thanks.
|||Hi Hilary,
Thank you for the indication. But I noticed that the condition should be
evaluated as in replication triggers : if (
sessionproperty('replication_agent') = 1 and (select trigger_nestlevel()) =
1) the first part alone is not enough to detect that the trigger has been
fired by replication agent.
Thanks.
"Hilary Cotter" wrote:
> query sessionproperty('replication_agent') to see if its value is 0. If so
> a replication agent is making the update, if it is 1, it is another user
> process.
> --
> Hilary Cotter
> Looking for a book on SQL Server replication?
> http://www.nwsu.com/0974973602.html
>
> "Oussama Albairat" <OussamaAlbairat@.discussions.microsoft.com> wrote in
> message news:990BF6F4-FF7A-4F76-B560-D9A02261FA3D@.microsoft.com...
> it
> the
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment