Problem determining dependencies?

vincentjvincentj Posts: 47
edited February 18, 2011 4:57PM in SQL Compare Previous Versions

I'm trying to synchronize my database and I keep getting errors such as the following:
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_blah"

Property cannot be added. Property 'MS_Description' already exists for 'dbo.blah'.

I thought SQL Compare was supposed to figure out the dependencies and build the script so that it would drop keys or properties before re-adding them? I'm trying to synchronize a single table and it pulled in 48 dependencies. Some of them I can understand but a lot of them don't make sense. For instance, there is a view in the dependency list that is not referenced anywhere else in the synchronization script.

It seems like there are some serious problems in the logic to determine dependencies, the result of which are scripts that don't work.

I'm looking for any suggestions about things to try differently. It seems wrong that I have to basically rewrite the synchronization scripts to get them to run.


  • I figured out the foreign key issue, it was because the table contained values that would violate the constraint because they were not in the list of primary keys in the other table. I deleted the offending data and that part of the script executed properly.

    I managed to work around the second issue by removing the transactions and running the script multiple times. I'm still curious if there's a better solution, because I don't think I'll be able to remove the transactions when deploying to live environments.
Sign In or Register to comment.