how to lookup works between two tables...how can i test that using sql query to verify the result of the lookup
-
Friday, April 06, 2012 9:26 AMhow to lookup works between two tables...how can i test that using sql query to verify the result of the lookup
ilikemicrosoft
- Changed Type Eileen ZhaoMicrosoft Contingent Staff, Moderator Monday, April 09, 2012 12:28 AM
All Replies
-
Friday, April 06, 2012 11:13 AM
Hello,
Follow the blog below. It will help you.
http://blogs.msdn.com/b/jorgepc/archive/2010/12/07/synchronize-two-tables-using-sql-server-integration-services-ssis-part-i-of-ii.aspx
-
Friday, April 06, 2012 3:16 PM
Hi,
Lookup takes input value and searches for a row in table that contains this value in the specified field.
once it finds it you are able to extract values from different fields that belong to the same row.
Find below scenario for the same.
Example:I have two tables EMP_MASTER , COUNTY_MASTER.
EMP_MASTER has columns EMPID,FIRSTNAME,COUNTYID
COUNTY_MASTER has columns COUNTYID,COUNTY_NAME
Requirement is I have to load data from EMP_MASTER to flat file, while loading this instead of COUNTYID, I need to load COUNTRY_NAME from COUNTY_MASTER based on COUNTYID . In this scenario we have to use lookup and fetch COUNTY_NAME.
The best way to verify the result of the lookup in T-SQL :
Write a JOIN QUERY by EMP_MASTER and COUNTY_MASTER ,on condition is COUNTYID
SUVARNA PEDDYREDDY
-
Friday, April 06, 2012 3:23 PMInsert a Dataviewer (Right click on green arrow between tranformations, Dataviewers-->Add-->Ok-->Ok) after all lookups, to sample the data you have. If you need synchronizing between tables, i suggest using upsert approach. If your data is huge, avoid using sort as much as possible, if it is mandantory to make a sort, do it in your query.
"Im the light of the world, no follower of mine shall walk in darkness"
-
Wednesday, April 11, 2012 6:29 AM
I guess the only difference between Lookup and Merge join is..Lookup will give match out and no match output.....
rest is same between Lookup and Merge join.....
ilikemicrosoft
-
Wednesday, April 11, 2012 6:34 AM
I guess the only difference between Lookup and Merge join is..Lookup will give match out and no match output.....
rest is same between Lookup and Merge join.....
ilikemicrosoft
Nope. Not at all. MERGE JOIN will take two sorted inputs and join them together.
The lookup doesn't need sorted input. Furthermore, a merge join can handle different types of join, while the lookup resembles only an inner join. I say resemble, because a lookup will return only the first match. A real inner join returns all matches.MCTS, MCITP - Please mark posts as answered where appropriate.

- Proposed As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Thursday, April 12, 2012 8:51 AM
- Marked As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Monday, April 16, 2012 2:31 PM

