Solved

SSIS Slowly Changing Dimension

Posted on 2010-08-23
7
663 Views
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...
0
Comment
Question by:johnnyaction
  • 4
  • 3
7 Comments
 
LVL 30

Accepted Solution

by:
Reza Rad earned 500 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:

http://www.experts-exchange.com/A_3422-How-to-handle-Failed-Rows-in-a-Data-Flow.html


0
 
LVL 1

Author Comment

by:johnnyaction
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'.".
SCD.docx
0
 
LVL 1

Author Comment

by:johnnyaction
ID: 33502257
reza,

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

John
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 1

Author Closing Comment

by:johnnyaction
ID: 33504727
Thanks for your help
0
 
LVL 30

Expert Comment

by:Reza Rad
ID: 33505491
sorry for delay on answering.
did your problem solved now?
Regards,
0
 
LVL 1

Author Comment

by:johnnyaction
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
0
 
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,
or
use Kimball SCD component
or
use Merge statement is T-SQL

and I think last one is better at all because all things will happen in server side exactly.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now