Table has foreign keys to other unsynchronized tables
gknierim
Posts: 31
I am comparing the data between 2 databases and I get 3 warnings concerning Foreign Key constraints. The 3 warnings concern 3 tables, of which none of them have foreign keys in them. The message is as follows:
The table [dbo].[States] has foreign keys to other unsynchronized tables, the database may be left in an inconistent state.
Now, my States table only has a PK and no foreign keys. However, I have another table (called Teams) that has a foreign key to the PK in my States table. Is this what it is trying to tell me? If so, then the message should indicate the table dbo].[Teams] has foreign keys...
Also, these warning also appear even though I have selected all of the tables so technically, it shouldn't be left in an inconsistent state if I've included them all. I guess I'm just looking for clarification to this message as I feel it is inaccurate and misleading unless someone can explain it to me. It makes me think that i don't have something selected when I really do.
Thanks,
Greg
The table [dbo].[States] has foreign keys to other unsynchronized tables, the database may be left in an inconistent state.
Now, my States table only has a PK and no foreign keys. However, I have another table (called Teams) that has a foreign key to the PK in my States table. Is this what it is trying to tell me? If so, then the message should indicate the table dbo].[Teams] has foreign keys...
Also, these warning also appear even though I have selected all of the tables so technically, it shouldn't be left in an inconsistent state if I've included them all. I guess I'm just looking for clarification to this message as I feel it is inaccurate and misleading unless someone can explain it to me. It makes me think that i don't have something selected when I really do.
Thanks,
Greg
Comments
As to why you are getting warnings even when you include all tables in the synchronization that is more worrying. Do some of your tables not require synchronization or something?
We're just putting the last few touches on version 6.1 so I'll see if I can re-word that message for the release.
Well spotted
Project Manager
Red Gate Software Ltd
Thanks Richard.
I am including all of the tables since I am comparing an existing database to a new blank database. All of the tables have records in them and all of them are selected. I do remember trying to sync just the table that I got the warning message about and it synced fine with no warnings. So in your test database, if you try syncing tbl5, it should not give a warning message (I would think).
I had upgraded to 6.0 and was getting the same warning messages as v5 so whatever it is doing has been doing it for a while maybe. I saw it once before (a while back) and I investigated the table it was complaining about and saw that it didn't have a foreign key so I just dismissed the warning message.
If you find anything out, please let me know.
Thanks,
Greg
Can all of the tables be compared, i.e. have they all have comparison keys set correctly?
I'm loath to go into that code and change too much as it's rather delicate in there, I did introduce a bug in 6.0 that I've fixed for 6.1.
The perils of being a programmer.
Project Manager
Red Gate Software Ltd
Ditto!
Is there any chance you can send me a minimal backup of the database that reproduces the problem and I can see if I can track it down that way. Alternatively if you could send me a sql compare snapshot so I can re-create the schema I could populate it with test data using our new tool that's in-development SQL Data Generator .
richard.mitchell@red-gate.com
Project Manager
Red Gate Software Ltd
I will see what I can do to send you a backup. It will probably be later this week though or the weekend. I will email it to you when I get it ready if that's ok.
Thanks,
Greg
Project Manager
Red Gate Software Ltd