June 21, 2015 at 8:56 pm
Previously same records exists in table having primary key and table having foreign key . we have faced 7 records were lost from primary key table but same record exists in foreign key table. What could be reason and what could be best solution for this issue. Urgently issue. I really appreciate if some one gives me suggestion and solutions for this.
June 22, 2015 at 1:29 am
keshab.basnet (6/21/2015)
Previously same records exists in table having primary key and table having foreign key . we have faced 7 records were lost from primary key table but same record exists in foreign key table. What could be reason and what could be best solution for this issue. Urgently issue. I really appreciate if some one gives me suggestion and solutions for this.
The only idea I have is that the FK was created WITH NOCHECK and therefore that the data has never been consistent.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
June 22, 2015 at 8:06 am
Dear Sir thanks for reply.
one of the table referencing to primary key table has FK WITH NOCHECK. However another table which has FK reference to primary key table, have FK with CHECK.
For example, Table_A has id as primary key. Table_b has id as FK key with WITH NOCHECK referencing to Table_A. But Table_C has FK with WITH CHECK referencing to Table_A.
Can there be possible loss of 5-7 records from Table_A. However same record id exists in Table_B and Table_C with same id. Previously, Table_A also has these 5-7 IDs. What could be the possible reason for loss of these id from Table_A even if that id exist in FK table Table_C.
Can you provide possible reasons and best solution?
June 22, 2015 at 8:32 am
.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply