February 9, 2009 at 11:45 am
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
February 9, 2009 at 1:51 pm
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
Consultant - Straight Path Solutions
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
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply