Interesting issue with my comparisons

fmeadsfmeads Posts: 7
edited June 4, 2008 9:01AM in SQL Toolkit Previous Versions
Wrote a small app to generate differences between our stagging and production databases. When we tested it we found that object which existed in both systems but were different were not included in the generated script. Does anyone have any insights? Below is the code I'm using:

Differences sdiff = db1.CompareWith(db2, Options.Default);
Work wrk = new Work();
wrk.BuildFromDifferences(sdiff,Options.Default,true);
StreamWriter sw = new StreamWriter(FilePath);
ExecutionBlock blk = wrk.ExecutionBlock;
sw.Write(blk);
sw.Close();

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi Frank,

    It's hard to say from the code fragment what the problem could be. I'd wager that it happens earlier in the program. Did you start with the Toolkit example project as a baseline to work from? In particular there is a loop where all difference objects have the selected property set to true. If this isn't done, then objects may not appear in the synchronization script. That's just a guess. The only way to work out why the result would not turn out as predicted would be to have all of your code and databases because this code fragment is not enough to go on.

    Thanks!
Sign In or Register to comment.