Merge Join missing records when not including a where in OLEBB Src

  • I have an oledb src where Im using the following tsql to pull data from a table:

    select RunDt,LoanNum as RawLoanNum, SeniorLoanNum as RawSeniorLoanNum, SrPayoff as RawSrPayoff,SrPayoffCalc as RawSrPayoffCalc from Lobotransform.dbo.RawAS400SrLienPayOff

    I'm setting the sort order on RunDt (1), and RawLoanNum (2) in the oledb src.

    I'm then using a merge join (Left outer join selected) to join the data into my data stream on Rundt and RawLoanNum. When I dont include a where clause on the RawLoanNum in my oledb src to specifically pull records that dont get joined I get them joined and they pass through the merge join, when I exclude the where clause and allow all to come through I am missing the records that I had in the where clause that I removed. I still see the records in the datagrid before reaching the merge join tran but they don't get joined. Can anyone shed some light on this please?

  • I figured it out, I forgot to add the Order By clause. Apparently having the the settings in the oledb src isnt enough to get it sorted you have to add the order by clause in your query.

  • dndaughtery (2/18/2012)


    I figured it out, I forgot to add the Order By clause. Apparently having the the settings in the oledb src isnt enough to get it sorted you have to add the order by clause in your query.

    That setting in the Advanced Editor of the OLE DB Source just tells the dataflow "hey, this data is sorted". It is a metadata operation, it doesn't sort the data for you.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

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

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