SQL Compare Drops Constraints and script does not recreate

abeljdaabeljda Posts: 2
edited September 13, 2007 6:50AM in SQL Compare Previous Versions
Hello, I have not used SQL Compare much so this might be a simple question, but I can not find why this is happening. When I do a simple compare of 2 tables, one which has 2 new columns in it, and go ahead with the synchronization script, the script is going to drop the original table and and recreate it to keep the new table columns in order, it drops the primary key on the table, creates a new temp table, inserts all the data but does not recreate the PK. Below is the action plan in SC that shows this. What am I missing? Thanks

UPDate: I completly recreated the compare project, and was able to get the constraints added back in, still not sure how I managed to eliminate them in the first place, but I do have it working now.

Drop primary keys (1 item)
Drop primary key [PK_TBSLoans_1__17] from table [dbo].[TBSLoans]
Drop defaults from columns (1 item)
Drop default DF_TBSLoans_Qtr_1__23 from column [Qtr] on table [dbo].[TBSLoans]
Rebuild tables (1 item)
Rebuild table [dbo].[TBSLoans]
Restore permissions (1 item)
Restore permissions on [dbo].[TBSLoans]


  • Hi there,

    It sound like you had the ignore constraints option enabled. You can find you option for the project on the Project Configuration > Options tab.


    Jonathan Watts

    -Project Manager
    -Red Gate Software Ltd
Sign In or Register to comment.