few record loss in table Primary key where same records exists in foreign key table

  • 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.

  • 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

  • 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?

  • .

    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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply