Table primary keys are dropped

mtranmtran Posts: 34
edited July 22, 2010 1:39PM in SQL Compare Previous Versions
When I ignore Indexes, the primary keys are dropped after syncing the table schema.

I have a table with 5 primary keys. It is initially there before the sync, but they are gone after syncing.

Please let me know if this is a bug and if theres a workaround for now.

Thanks

Comments

  • We are actually using the SDK, not the UI version. But when we compare using the UI, it does not show any differences even tho the primary keys are not there.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello Meng,

    I'm sure that the problem lies with not setting your options in all of the right places. There are two places where you can specify the options used in the comparison, one on the Register method, and the second on the BuildFromDifferences method. If you omit the second set of options, or use the default, the keys will be compared and synchronized. Please see our code samples for an example.
  • Thanks, I will take a look at the code again.

    How come when I use the UI, it does not show any differences in the table structure but the primary keys are not set in the destination database?
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Your are ignoring keys and indexes in the options?
  • There is an ignore Indexes option.

    I do not see one for keys. There is Foreign keys but no primary keys.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    You can only ignore indexes. The API options don't distinguish Primary Keys from other kinds of indexes.
  • So you mean I will have to sync the indexes if I also want the primary keys to move?

    This has never happened before though. Previous versions did not remove primary keys.

    I believe there is a max of 200 indexes that can by synced. We have run into this previously where it will error if there are more than 200 indexes. I think that was the reason why we ignored indexes during syncing.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    The behavior in the API has not changed. We may have to pick this case up and work it via email because it's starting to look like we may have to investigate/debug the API.
Sign In or Register to comment.