Adding WITH CHECK to Foreign Keys

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

Adding WITH CHECK to Foreign Keys

Postby dblanchett » Fri Sep 07, 2012 9:48 am

Is there a way to have SQL Compare include the WITH CHECK option when it creates or alters a foreign key constraint? There is an option to do this in SQL Data Compare but I can not see how to do this in the Schema compare.

Posts: 1
Joined: Fri Sep 07, 2012 9:44 am

Postby Brian Donahue » Mon Sep 10, 2012 3:26 pm


SQL Compare should script objects exactly as they were created. So if you did not specify, it should recreate foreign keys WITH CHECK. If the foreign key was originally created WITH NOCHECK, it should be recreated that way if it needed to be dropped and created or just newly-created. The way to override that would be to use the Ignore->WITH NOCHECK option.
Brian Donahue
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests