May 5, 2010 at 1:33 pm
We have a proc that has been working fine...but for no known reason, it is now (sometimes) adding a duplicate record.
Select AccountLink.*,[Transaction].*, TransactionDataValue.*,TransactionData.*
From TransactionDataValue
inner join TransactionData On TransactionDataValue.TransactionDataValueID = TransactionData.TransactionDataValueID
Right Outer join [Transaction] On TransactionData.TransactionID = [Transaction].TransactionID
inner join AccountLink On [Transaction].AccountLinkID = AccountLink.AccountLinkID
inner join TransactionServiceProviderAccount On TransactionServiceProviderAccount.TransactionServiceProviderAccountID = [Transaction].TransactionServiceProviderAccountID
Where TransactionServiceProviderAccount.TransactionServiceProviderID = @TransactionServiceProviderID
And [Transaction].DateNext <= @Date
And ([Transaction].DateEnd > @Date or [Transaction].DateEnd is null)
And [Transaction].Active = 1
For XML Auto
Is it possible it's due to index fragmentation>?
I have almost no clue as to where to start looking..
May 5, 2010 at 2:16 pm
It is unlikely that SQL Server will "all of a sudden" display duplicate rows.
It is more likely that you have duplicate entries in one of your table leading and, based on your join conditions, leading to duplicated rows.
Since you cannot find differences in the columns you selected I'd expect the duplcate value to be in TransactionServiceProviderAccount.
If you add that table to your Select statement you'll most probably figure that the rows are no longer completely duplicates - most probably there will be duplicate rows except the data from TransactionServiceProviderAccount.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply