SSIS Slowly Changing Dimension

Posted on 2010-08-23
Medium Priority
Last Modified: 2013-11-10
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...
Question by:johnnyaction
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 30

Accepted Solution

Reza Rad earned 2000 total points
ID: 33501647
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:



Author Comment

ID: 33501732
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'.".

Author Comment

ID: 33502257

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Closing Comment

ID: 33504727
Thanks for your help
LVL 30

Expert Comment

by:Reza Rad
ID: 33505491
sorry for delay on answering.
did your problem solved now?

Author Comment

ID: 33505825
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
LVL 30

Expert Comment

by:Reza Rad
ID: 33507991
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.

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question