How to differentiate between a replication trigger and a normal trigger using
T-SQL?
In merge replication I am almost sure they all start with del_, ins_, upd_.
Jos.
"ravi lobo" <ravilobo@.discussions.microsoft.com> wrote in message
news:723D2643-3DC9-4553-8642-63A3797260A3@.microsoft.com...
> How to differentiate between a replication trigger and a normal trigger
> using
> T-SQL?
|||That is correct! But is there a flag in some column?
"José Araujo" wrote:
> In merge replication I am almost sure they all start with del_, ins_, upd_.
> José.
>
> "ravi lobo" <ravilobo@.discussions.microsoft.com> wrote in message
> news:723D2643-3DC9-4553-8642-63A3797260A3@.microsoft.com...
>
>
|||Not sure, but I would check the Sysobjects.Category column for those
triggers (and compare it to user generated triggers).
I just took a quick look and Category seems to be =2 for replication
triggers - users triggers seems to be 0.
Note: I didn't really check it throughfully...
Jos.
"ravi lobo" <ravilobo@.discussions.microsoft.com> wrote in message
news:7ADB93A3-B287-4D07-A521-00E099198AD1@.microsoft.com...[vbcol=seagreen]
> That is correct! But is there a flag in some column?
> "Jos Araujo" wrote:
|||José,
This is not correct. I have a merge replication setup. I am not getting
category=2 for merge triggers.
-Ravi
"José Araujo" wrote:
> Not sure, but I would check the Sysobjects.Category column for those
> triggers (and compare it to user generated triggers).
> I just took a quick look and Category seems to be =2 for replication
> triggers - users triggers seems to be 0.
> Note: I didn't really check it throughfully...
> José.
|||Yeah... I think you are better off relaying on the name conventions.
However you can only do that if you are the one naming the other triggers.
Good luck
"ravi lobo" <ravilobo@.discussions.microsoft.com> wrote in message
news:236CF93E-F981-4ED1-86C2-E21920F0C2DF@.microsoft.com...
> Jos,
> This is not correct. I have a merge replication setup. I am not getting
> category=2 for merge triggers.
> -Ravi
>
> "Jos Araujo" wrote:
>
|||I have checked the naming it is reliable unless you also create the triggers
with similar name which is rare.
The following query gives the replication trigger id's,
select deltrig,instrig,updtrig from sysobjects where replinfo=128
Hope this helps..
-Ravi Lobo
"Laurence" wrote:
[vbcol=seagreen]
> Did anyone ever find a reliable way of identifying replication triggers? I
> need a way to do this with 100% certainty so I can't reply on the naming
> convention.
> Thanks
> "José Araujo" wrote:
|||Did anyone ever find a reliable way of identifying replication triggers? I
need a way to do this with 100% certainty so I can't reply on the naming
convention.
Thanks
"José Araujo" wrote:
> Yeah... I think you are better off relaying on the name conventions.
> However you can only do that if you are the one naming the other triggers.
> Good luck
> "ravi lobo" <ravilobo@.discussions.microsoft.com> wrote in message
> news:236CF93E-F981-4ED1-86C2-E21920F0C2DF@.microsoft.com...
>
>
|||select 'tablename'=object_name(objid),sysobjects.name from sysmergearticles
join sysobjects on sysobjects.parent_obj =objid
where sysobjects.type='tr'
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Laurence" <Laurence@.discussions.microsoft.com> wrote in message
news:83BB18E8-E329-4331-B372-91A1FD2D99D5@.microsoft.com...[vbcol=seagreen]
> Did anyone ever find a reliable way of identifying replication triggers? I
> need a way to do this with 100% certainty so I can't reply on the naming
> convention.
> Thanks
> "Jos Araujo" wrote:
|||Hilary..I think your query lists all the triggers on replicated tables
(System+user). I think the requirement here is only for system triggers.
-Ravi Lobo
"Hilary Cotter" wrote:
> select 'tablename'=object_name(objid),sysobjects.name from sysmergearticles
> join sysobjects on sysobjects.parent_obj =objid
> where sysobjects.type='tr'
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "Laurence" <Laurence@.discussions.microsoft.com> wrote in message
> news:83BB18E8-E329-4331-B372-91A1FD2D99D5@.microsoft.com...
>
>
Tuesday, March 20, 2012
Replication and normal trigger
Labels:
database,
differentiate,
microsoft,
mysql,
oracle,
replication,
server,
sql,
trigger
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment