Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.


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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

636 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