SSIS Slowly Changing Dimension

I have inherited alot of SSIS packages and I am seeing a common theme. He uses a SCD for every load of data to a table he has. There is one table in particular that is failing on the load in multiple packages. I have an OLEDB source with a SCD that has an OLEDB Destination(New records) and an OLEDB Command used for updates. All the packages fail when trying to load to this table saying that its is a violation of Unique Key. I am somewhat new to the SCD but I get how it works for the most part. Any help would be appreciated.

I'll give an additional 500 points if I get this figured out today...
Who is Participating?

Improve company productivity with a Business Account.Sign Up

Reza RadConnect With a Mentor Consultant, TrainerCommented:
when a violation on a constraint happens, task fail and as a result whole package fail.
you should set Failed Error Output and configure it to handle violating Unique key errors.
this is my article about how to handle the Failed Error Output:

johnnyactionAuthor Commented:
This is the error I am getting when I execute the package. My question is, why would it try to do an insert into a table when it should be doing the update? Doesnt the Slowly Changing Dimension handle that? I have attached a pic of what I am trying to run.

[Insert Destination [728]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E2F. An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80040E2F  Description: "The statement has been terminated.". An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80040E2F  Description: "Violation of UNIQUE KEY constraint 'AK_DimProduct'. Cannot insert duplicate key in object 'dbo.DimProduct'.".
johnnyactionAuthor Commented:

I added the new table and redirected the failed rows to this table. The package ran with Success but it did not write any rows to the FailedRows table? This is making me think that it may not have run properly? Any thoughts

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

johnnyactionAuthor Commented:
Thanks for your help
Reza RadConsultant, TrainerCommented:
sorry for delay on answering.
did your problem solved now?
johnnyactionAuthor Commented:
I am just curious how I did not get any values put into my FailedRows table. It fails without the redirect rows. Also, why would it fail in the first place. If the key exists its supposed to do an Update if it doesnt then Insert. So Im not sure why this redirect would be needed? Any clarification would be appreciated. Thanks
Reza RadConsultant, TrainerCommented:
where did you set FailedRows? in destination?
and about SCD: did you configure it correctly?

and last thing:
I don't suggest SCD at all, because this has performance issue, you can use
Lookup Transformation with better performance,
use Kimball SCD component
use Merge statement is T-SQL

and I think last one is better at all because all things will happen in server side exactly.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.