First of all, you don't normally need to link InvoiceLine to Invoice because InvoiceLine contains most of the information in the Invoice header anyway. But to prove my point, and address your point, I ran the following queries:
SELECT InvoiceLine.TxnID, InvoiceLine.invoiceLineTxnLineID, Invoice.TxnID, InvoiceLine.IsPaid, Invoice.IsPaid FROM InvoiceLine, Invoice where InvoiceLine.TxnID = Invoice.TxnID
Results 917 Rows
SELECT InvoiceLine.TxnID, InvoiceLine.invoiceLineTxnLineID, Invoice.TxnID, InvoiceLine.IsPaid, Invoice.IsPaid FROM InvoiceLine, Invoice where InvoiceLine.TxnID = Invoice.TxnID and InvoiceLine.IsPaid <> Invoice.IsPaid
Results 0 Rows
There were no differences found. I suggest you run this on your system too! If there are results, try this instead:
SELECT InvoiceLine.TxnID, InvoiceLine.invoiceLineTxnLineID, Invoice.TxnID, InvoiceLine.IsPaid, Invoice.IsPaid FROM InvoiceLine, Invoice Unoptimized where InvoiceLine.TxnID = Invoice.TxnID and InvoiceLine.IsPaid <> Invoice.IsPaid
If there only 0 results using the Unoptimized tag, then you will need to resync you optimized tables by doing:
sp_optimizefullsync InvoiceLine
and
sp_optimizefullsync Invoice
|