SQL Server Performance

Merge Left Outer Join giving all null values for the right table

Discussion in 'SQL Server 2005 Integration Services' started by samsqlserver, May 12, 2009.

  1. samsqlserver New Member

    Hi All,
    I am doing a Merge Join(Left Outer Join) on two OLEDB data sources inside a data flow task.
    Source1 is CustomerTableA, Source2 is CustomerTableB. Join is on CustomerID
    CustomerTableA has 21 rows with CustomerID values from 1 to 21.
    CustomerTableB has 20 rows with CustomerID values from 1 to 20.
    I want to see the output of this transformation as 21 rows with null value from CustomerTableB where CustomerTableA.CustomerID = 20.
    Apparently, I am getting 21 rows as the result but all the rows from the right table show null values.
    Can someone suggest a work around for this one?
    Thanks for ur time...
  2. Sandy New Member

    You are using a LEFT JOIN and Right Table is giving NULL Value and you are worried for this?
    What type of left join are you using for your query? Are you using LEFT JOIN OR LEFT OUTER JOIN? ([:cool:]).

    Yes, it’s obvious if you don’t have the matching record in the right table it will return you as NULL value. Where is the problem?
    You are in correct path. Be happy now… [:)]

Share This Page