For XML Auto

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

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



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

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