Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSIS inserting duplicates Expand / Collapse
Author
Message
Posted Tuesday, June 15, 2010 11:11 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, June 16, 2010 5:48 AM
Points: 42, Visits: 110
Hi,

I have an SSI package where I get data from source table, lookup for surrogate key in destination db and inserting into destination DB. While doing this, if we could not find some data in the destination DB, we insert dummy data into destinationDB for generating surrogate key and again lookup for surrogate key in destination db for that missing data. then union all these both data and finally insert into destination DB into another dimension table.

Now the problem is sometimes we are getting data inserted twice(exactly duplicate).
Post #937926
Posted Wednesday, June 16, 2010 7:27 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, November 4, 2014 4:16 AM
Points: 346, Visits: 519

Can you be more specific on the workflow? Are you using sql query/sp anywhere or integration service components all the way?


--
Sabya
Post #938164
Posted Wednesday, June 16, 2010 9:25 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, May 16, 2011 8:40 AM
Points: 60, Visits: 117
Here you are using Lookup Cascading Pattern. Please make sure the following:

1. First Lookup -- Setup the cache property to FULL Cache. This will have 2 outputs for you. 1 All exact match records and second rejected records.

All Exact match records direct them to UNION ALL task.

2. For Rejected records in Setp1 -- map it to second look up and set its properties to partial Cache.

All matches redirect them to UNION All Task.

3. Rejected records in Step 2 -- Map it to NO Cache lookup

All matches redirect them to UNION All task

Rejected records created a surrogate key in the lookup and then update the record and redirect output to UNION all.

It would be nice if you could give a image of your current SSIS package for further inputs.
Post #938331
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse