Query regarding Look Up Transformation
Look up transformation fetching multiple matched records.More information as below
1. Input data comes from a table called Contact(ContactID is unique in this table) and this data is cached using cache transform
CREATE TABLE Contact
(
FirstName NVARCHAR(255),
MiddleName NVARCHAR(255),
LastName NVARCHAR(255),
ContactId INT
)
2. Reference data comes from table called Sales(ContactId is comes more than one times or we can say between Contact table and Sales table there is one to many relationship) table structure as below
CREATE TABLE Sales
(
ContactID INT,
TotalDue MONEY
)
3.In Sales table there are duplicate rows for Contactid 1
1 5370.284
1 5370.284
1 5370.284
1 5370.284
1 5370.284
1 5370.284
1 5370.284
when i create package using look transformation
in Look Up Matched Output pulls all the rows
(duplicate) from Sales table.As per definition 'If there are multiple matches in the reference table, the Lookup transformation returns only the first match returned by the look up query.'
What could be the issue
Smash126
August 11th, 2012 2:14pm
Could you please explain what you want to achieve using this Data Flow Task?
we cannot suggest you a solution to your issue without understanding the requirements.
Please mark the post as answered if it answers your question
Free Windows Admin Tool Kit Click here and download it now
August 11th, 2012 6:47pm
What i want to achieve is i want only the first matched row
Smash126
August 12th, 2012 1:57am
You want only first matched row, then use sql command in look up transformation instead of table or view.
Use the below query in sql command,
select distinct ContactID,TotalDue
from Sales
Regards,
YB
Free Windows Admin Tool Kit Click here and download it now
August 12th, 2012 12:30pm