Replication related solution in needed -- urgent

  • I have critical two tables in our Production Database and these 2 tables have frequent inserts, updates & deletes. So we need to replicate these 2 tables on to different server for only transactions that happens through our application login. I.e. if I connect to DB and update the values in publisher table it should not replicate them to subscriber and it should only replicate the values when it comes from application login.

    Ps: Replication is the solution I thought about…. But you can suggest some other robust solution, if any.

    Hope query is clear to everyone.

    Rgds,
    Pankaj

  • This solution may need some work, but:

    Can you create a specific user mapped to that login for your production database, and then include a column on those tables that's something like "LastUpdatedByUser".

    A trigger AFTER UPDATE can set the "LastUpdatedByUser" column, and maintain that value for you (using the USER keyword for the current user executing the query). (UPDATE [MyTable] SET [LastUpdatedByUser] = USER).

    Once you have a column that stores the user name of who last updated the record, you can include that column in a filter condition on your replication publication.

    I'm not sure if that's exactly what you're looking for or not, but basically only records updated by a specific user are included in a subscription.

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

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