Bug? - Ignore WITH NOCHECK
randyminder@yahoo.com
Posts: 30
I did a SQL Compare between my scripts and a physical database. In one of my scripts I have the following statement:
ALTER TABLE [dbo].[ProjectAccount] WITH NOCHECK ADD
CONSTRAINT [FK_ProjectAccount_AccountGroup] FOREIGN KEY ([AccountRowID]) REFERENCES [dbo].[AccountGroup] ([RowID])
This constraint does not exist in the target database. SQL Compare correctly detected the constraint needed to be added but it left off the WITH NOCHECK argument when it created the T-SQL to add the constraint. In my compare options I have the 'Ignore WITH NOCHECK' checked.
It seems that even though the constraint is going to be added as new, since I've told SQL Compare to ignore WITH NOCHECK, it leaves the argument off in the synch script. My understanding was that the WITH NOCHECK option only applies when comparing constraints that exist in both the source and target, and if WITH NOCHECK is the only difference, it doesn't get flagged as a schema difference. It seems that this option also means that if the constraint is new, the WITH NOCHECK argument will not get included in the constraint. Is this a bug or working as designed?
Thanks - Randy
ALTER TABLE [dbo].[ProjectAccount] WITH NOCHECK ADD
CONSTRAINT [FK_ProjectAccount_AccountGroup] FOREIGN KEY ([AccountRowID]) REFERENCES [dbo].[AccountGroup] ([RowID])
This constraint does not exist in the target database. SQL Compare correctly detected the constraint needed to be added but it left off the WITH NOCHECK argument when it created the T-SQL to add the constraint. In my compare options I have the 'Ignore WITH NOCHECK' checked.
It seems that even though the constraint is going to be added as new, since I've told SQL Compare to ignore WITH NOCHECK, it leaves the argument off in the synch script. My understanding was that the WITH NOCHECK option only applies when comparing constraints that exist in both the source and target, and if WITH NOCHECK is the only difference, it doesn't get flagged as a schema difference. It seems that this option also means that if the constraint is new, the WITH NOCHECK argument will not get included in the constraint. Is this a bug or working as designed?
Thanks - Randy
Comments
Redgate Software