Monday, March 19, 2012

maintaining triggers on initial snapshot...

I have transactional replication setup with an updatable subscriber. I want
the trigger on the publisher to transfer over to the destination during the
initial snapshot (the drop/create is where I lose the trigger). In the GUI,
properties of the publisher, Articles tab, clicking the elispse then on the
Snapshot tab, there is a checkbox 'User Triggers'. But when I check this and
reinitialize the snapshot and subscriber, the table get dropped and
recreated on the subscriber (as it should) but again WITHOUT the triggers
that are on the publisher.
Any help is greatly appreciated.
Thanks.
Appendage to initial post...
So i discovered the @.schema_option = 0x100 Replicates user triggers on a
table article, if defined.
and when i script out my publisher i see
@.schema_option = 0x000000000000CEF3 and
@.schema_option = 0x000000000000CFF3
(the first one is for a table that does not have the user triggers option
set and the second one does so it makes sense that one has E and the other
F. But this is still not working.
On the publisher I have a trigger:
CREATE TRIGGER tr_CustomerAsset_BreakoutClassifyFieldsAndMatchEqu ipment ON
dbo.CustomerAsset
but after snapshot, this trigger is not at the subscriber.
Thanks everyone!
"Terry Mulvany" <terry.mulvany@.rouseservices.com> wrote in message
news:eoOv3bOZHHA.4264@.TK2MSFTNGP05.phx.gbl...
>I have transactional replication setup with an updatable subscriber. I want
>the trigger on the publisher to transfer over to the destination during the
>initial snapshot (the drop/create is where I lose the trigger). In the GUI,
>properties of the publisher, Articles tab, clicking the elispse then on the
>Snapshot tab, there is a checkbox 'User Triggers'. But when I check this
>and reinitialize the snapshot and subscriber, the table get dropped and
>recreated on the subscriber (as it should) but again WITHOUT the triggers
>that are on the publisher.
> Any help is greatly appreciated.
> Thanks.
>
|||This should work. I would try to re-apply them using a post snapshot script.
Hilary Cotter
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
"Terry Mulvany" <terry.mulvany@.rouseservices.com> wrote in message
news:eoOv3bOZHHA.4264@.TK2MSFTNGP05.phx.gbl...
>I have transactional replication setup with an updatable subscriber. I want
>the trigger on the publisher to transfer over to the destination during the
>initial snapshot (the drop/create is where I lose the trigger). In the GUI,
>properties of the publisher, Articles tab, clicking the elispse then on the
>Snapshot tab, there is a checkbox 'User Triggers'. But when I check this
>and reinitialize the snapshot and subscriber, the table get dropped and
>recreated on the subscriber (as it should) but again WITHOUT the triggers
>that are on the publisher.
> Any help is greatly appreciated.
> Thanks.
>

No comments:

Post a Comment