• Try creating a UNIQUE KEY constraint with both the columns on GV_Voucher table.

    Your FOREIGN KEY constraint in GV_ReceivedOffice table should again be based on these 2 columns.

    ALTER TABLE GV_ReceivedOffice ADD CONSTRAINT FK_ReceivedOffice_Voucher_VoucherNo_TransactionID

    FOREIGN KEY (VoucherNo,TransactionID) REFERENCES GV_Voucher (VoucherNo,TransactionID)


    Kingston Dhasian

    How to post data/code on a forum to get the best help - Jeff Moden
    http://www.sqlservercentral.com/articles/Best+Practices/61537/