Perform some custom inserts during or after replication

  • I am new to replication so forgive me if this is an easy question.  My subscriber database is being used as a read-only database which is used by a search tool.  This search tool requires 3 special tables that are not in the live database (publisher database).

    What I would like to do is when certain data is inserted into the subscriber database I would like to insert some records into these 3 special tables.

    What is the best/cleaniest way to achieve something like this?

  • Modify the appropriate replication stored procedures to do just that ?


    * Noel

  • Oops - I missed the "during" bit...

    /Vincent

  • You could also consider writing a stored procedure that does what you want and insert a job step to the distribution job after the Run Agent step in which you call that stored procedure. Ensure you adjust the On Success and On Failure actions accordingly.

    /Vincent

     

     

  • You could also add triggers to the concerned tables. Note that modifying the insert proc or adding a subscriber side trigger are both brittle - could get dropped if you resnapshot and use the default settings.

  • Thanks!  Good to know.  That is what I ended up doing was adding triggers to the concerned tables.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply