Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


handling nomatch output from Lookup in SSIS


handling nomatch output from Lookup in SSIS

Author
Message
r_corp
r_corp
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 33
Hi All,
I loaded my lookup values into a sql database. i am using lookup task to compare my source file column to lookup values in the sql database. My match output is fine however my no match output is Nulls for the lookup column. I want to capture the actual column value instead of null values. Can you please let me know how to achieve that. Thanks in advance.
herladygeekedness
herladygeekedness
Old Hand
Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)

Group: General Forum Members
Points: 318 Visits: 813
If I am understanding correctly, the field you are bringing into the flow via Lookup is null where there is no match (as it should be) but you wish for it to have a value, but that value cannot be found via lookup.

In which case you can use derived column component to change every row with Null in that field to Something Else of your choosing.
r_corp
r_corp
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 33
I think I confused everyone with my post. I apologize for that. So, I am posting here with a sample

My source file has data like below

PA,East,USA
CA,West,USA
FL,South,USA
WA,North,USA

and my lookup table in SQL database has the below information

Short_Name Long_Name
PA Pennsylvania
CA California
FL Florida

And I am using a lookup task to convert my column1 in the source file to Long_Name. When I execute my package my match output is like below (As expected)

Match Output from lookup
------- ------- ----- --------
Pennsylvania,East,USA
California,West,USA
Florida,South,USA

and my NoMatch output looks like below

,North,USA

What I am saying is if it wont find a match (in case of WA from sample data) I want to see my nomatch output as below
WA,North,USA

Appreciate your help. Tnx
r_corp
r_corp
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 33
Anyone have any suggestions? thanks for your time.
Daniel Bowlin
Daniel Bowlin
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2954 Visits: 2629
If you are actually using the No Match Output of the Lookup transform:
All of the columns in the input are generally available in the output regardless of match or no match. Are you looking at a Data Viewer for the results in your example, or at some saved output like a flat file or database table. If you are looking at a saved output, then you need to change your mapping to the output file.

If you are keeping the no match in the main data stream with all the other data then you need to evaluate the values and replace them with a derived column as herladygeekedness suggests. Something like
ISNULL(LongName)?ShortName:LongName
will return the ShortName when LongName is null and LongName otherwise.
r_corp
r_corp
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 33
I got it working. I havn't made any noticeable changes to my package. I created some data viewers to see the data flow in the package. Now my nomatch output is giving me the right data (WA,North,USA) instead of creating a blank for the column that doesnt have a lookup value in the reference dataset(,North,USA).
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search