SQL Server Developer Center >
SQL Server Forums
>
SQL Server Integration Services
>
Lookup not working as expected
Lookup not working as expected
- Hi,
I have a lookup where i check if order exists. If an order doesn't exist i want to redirect the rows to a certain step in the data work flow and orders that do exist i want to redirect to another step in the data work flow. However, the lookup for some reason redirects all rows to the same step and doesn't split the orders to the steps i want. I tried none and partial cache but that doesn't help either.
Any ideas?
Thanks
Answers
- If the lookup fields (the ones you are trying to match) are character fields, remember that the lookup component does CaSE sensitive matching, and will honor trailing white spaces, so in cases like this, it is always best to:
- UPPER/LOWER case both sides of the lookup. You can use a derived column to do this on the data flow side, and you can use the UPPER/LOWER function in a SQL statement to do the lookup side.
- LTRIM(RTRIM()) the data on both sides. Again, you can use the derived column from above to combine these two steps. Same for the SQL statement in the lookup.
Phil Brammer | http://www.ssistalk.com | Twitter: http://twitter.com/PhilBrammer- Marked As Answer byNai-dong Jin - MSFTMSFT, ModeratorTuesday, November 10, 2009 3:41 AM
All Replies
- Can you double check on the data that flows in and the data against which it is compared?
Did you placed a conditional split to split the output of the lookup into two one for matched orders and other for unmatched orders?(Ignore failure should be set for this type)
Thanks, Bharani M - Please mark the post as answered if it answers your question. - Please vote the post as Helpful if you find the post as helpful. - So you mean that all the records from lookup goes to one output (red or green).
Where does all the records going to? (Red or Green op)
Try with default full cache mode only.
Have you checked for Null values of the column used as Join ccondition?
Are you taking care of case and empty spaces? (Lookup in full cache mode is case sensitive)?
Nitesh Rai- Please mark the post as answered if it answers your question Hi,
I have a lookup where i check if order exists. If an order doesn't exist i want to redirect the rows to a certain step in the data work flow and orders that do exist i want to redirect to another step in the data work flow. However, the lookup for some reason redirects all rows to the same step and doesn't split the orders to the steps i want. I tried none and partial cache but that doesn't help either.
Any ideas?
Thanks
Are all the records going in the error output?
Trim the data and convert the comparson column in source and lookup table to upper or lower case as it is case sensitive.
Hope this helps !!
Sudeep | My Blog- If the lookup fields (the ones you are trying to match) are character fields, remember that the lookup component does CaSE sensitive matching, and will honor trailing white spaces, so in cases like this, it is always best to:
- UPPER/LOWER case both sides of the lookup. You can use a derived column to do this on the data flow side, and you can use the UPPER/LOWER function in a SQL statement to do the lookup side.
- LTRIM(RTRIM()) the data on both sides. Again, you can use the derived column from above to combine these two steps. Same for the SQL statement in the lookup.
Phil Brammer | http://www.ssistalk.com | Twitter: http://twitter.com/PhilBrammer- Marked As Answer byNai-dong Jin - MSFTMSFT, ModeratorTuesday, November 10, 2009 3:41 AM


