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


Lookup Transformation


Lookup Transformation

Author
Message
kaladharreddy15
kaladharreddy15
SSC Rookie
SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)

Group: General Forum Members
Points: 34 Visits: 199
Hi Friends,

I need to load the data from temp table to target table every month
that should be check for existing data if exist update the data other wise insert new records for every month
I am planning to implement Lookup transformation in SSIS package
please let me know the steps to implement Lookup transformation

Here I am mentioning tables:
Temp Table:
ID OrgID HSTC JRTD LTD Employer EmployerPhoneNo JobTitle PlacementDataEntryStatus



Target Table:
PlacementID IntakeID HSTC JRTD LTD Employer EmployerPhoneNo JobTitle PlacementDataEntryStatus

Here PlacementID is Autogeneratedkey
Jack Corbett
  Jack Corbett
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11044 Visits: 14858
If your temp table and your real table are in the same database or on the same server you should use an Execute SQL Task to do this. Your code would be something like this:

Update real_table
Set columns = TT.columns
From
real_table RT Join
temp_table TT On
RT.unique_key = TT.unique_key

Insert Into real_table
Select
columns
From
temp_table TT
Where
Not Exists(Select 1 from real_table RT where TT.unique_key = RT.unique_key)





Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
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