Enable auditing on a replicated table

  • I have a requirement to enable auditing on a replicated table. To acheive this, I have created 3 procedures [one each for update, insert and delete] that would insert the records into an audit table before the transactions are applied to the target table.

    I have replaced the procedure call at the article properties with the ones I have created.

    This works fine. But, when the subscribers are re-initialized and the snapshot is generated, the procedures change automatically and the auditing part disaperas.

    Can anyone please suggest a way of acheiving the auditing on the replicated table?

  • Why are you re-initializing subscribers? That usually drops and rebuilds the table, so triggers would be deleted. You'd need to add them back.

    Don't reinitialize. You shouldn't have to do this.

  • There are a few other articles that gets changed time and again which prompts to re-initialize the subscription.

    I have found a workaround to acheive this.

    After the initial snapshot is delivered, on the article properties,

    1. uncheck the "Create the stored procedures during initial synchronization of subscriptions" option on the Commands tab.

    2. On the snapshots tab, choose "Delete all data in the existing table" option

    This does not drop and recrete the procedures. Your inputs prompted me to change these properties. Thanks Steve.

Viewing 3 posts - 1 through 2 (of 2 total)

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