Dependent SyncSteps

posted Apr 6, 2011, 7:30 AM by Ezra Kenigsberg   [ updated Apr 7, 2011, 8:04 AM ]

#DataTipOfTheDay 2011-04-06

Q: "In Synchronizer: how do I make SyncStep #2 run only if SyncStep #1 ran successfully?"

A: I don't have an explicit way of making SyncSteps dependent on previous SyncSteps, but this workaround should work. Basically, we're making the second SyncStep's source query dependent on the first SyncStep's error table. Here's an example:

ASSUMPTIONS:
  • We have two insert SyncSteps, #1 and #2.
  • SyncStep #1's source is Query1.
  • SyncStep #2's source is Query2.
REQUIREMENT:
  • If any records in SyncStep #1 fail, SyncStep #2 should not run.
SOLUTION:
  • Add a WHERE clause to Query2 that reads
    WHERE (SELECT COUNT(1) FROM tbl01_Query1_error) = 0
That should do it. Thanks to Larry Leonidas for the question!
Comments