Ignoring Diffs in Enabled vs. Disabled? Foreign Keys

mjswartmjswart Posts: 4
I'm running SQL Compare 10.4.8.87

I'm comparing two databases: The first is defined like this:
create database [Disabled]
go

use [Disabled]
go

create table A 
(
   id int identity primary key
)

create table POINTER1
(
   id int identity,
   a_id int,
   constraint pk_POINTER1 primary key (id)
)
go
		
ALTER TABLE POINTER1 
	WITH NOCHECK ADD CONSTRAINT FK_A_POINTER FOREIGN KEY (a_id) REFERENCES A (id)
go

ALTER TABLE POINTER1 NOCHECK CONSTRAINT FK_A_POINTER;
go

The second is defined like this:
create database [Enabled-NotTrusted]
go

use [Enabled-NotTrusted]
go

create table A 
(
   id int identity primary key
)

create table POINTER1
(
   id int identity,
   a_id int,
   constraint pk_POINTER1 primary key (id)
)
go

insert A default values;
insert POINTER1 (a_id) values (2);
go
		
ALTER TABLE POINTER1 
	WITH NOCHECK ADD CONSTRAINT FK_A_POINTER FOREIGN KEY (a_id) REFERENCES A (id)
go

When ignore nocheck is disabled (triple negative! meaning scrutinize nocheck), these compare as different (good!)
When ignore nocheck is enabled, these compare as the same, but that's not what I expected. The docs say disabled FKs are not ignored with this option and yet it seems to be ignored.

In my project, I really would like to ignore FK trustedness, but I really want to care about FK disabledness.

Comments

Sign In or Register to comment.