Initialize Subscription When Using Custom Ins Del Upd Procs

  • I have a data warehouse that is a subscriber in transactional replication, but uses custom cdc tables, and the publication articles use custom procs for inserting updating and deleting. Basically, the schemas are a bit different between the published database and the data warehouse, but this is handled in the custom procs. Everything works fine, except there is some initial seed data inserted into the set up script for the database that is published, before replication can be turned on.

    Is there a way to make a snapshot, or a subscription initialization to use the custom insert proc for any existing data in the publication database? I don't need schema information pushed, just the data, in the form as if it was triggered by an insert after being set up, if this makes sense.

    There's nothing I can do about the seed data, or the replication structure as it stands. What I seem to need is for existing data to be pushed as new inserts.

    Thanks,

    Dennis

  • Not sure how 'automated' you need this process to be? If you're able to generate the snapshot then go in and manipulate the relevant .sch files before running the distributor, then you could script out the required INSERTs to populate your seed data and add them into .sch file(s) each time you need to re-initialise?

  • What we decided to try is make and run procs that update the existing seed data to trigger the push. However now the issue is that these update statements are not being picked up by the log reader, because the updates set the column in question to itself. Apparently SQL Server does not log when you this. I tried a self join, same thing. I even tried creating a temp table of the original table and joined it to update from the identical temp table, same thing. Updates otherwise are working as intended and are coming through, when data actually changes.

    Does anyone know of a setting or a way to force the self update to log even though the data is not technically changing?

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

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