|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Today @ 7:29 AM
Points: 747,
Visits: 2,090
|
|
| I agree with ashokdasari, the MERGE is what I would do in this particular situation. I actually use the MERGE to handle TYPE II SCD in my data warehouse scenario. Very quick and powerful.
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 2:11 AM
Points: 9,378,
Visits: 6,473
|
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Today @ 7:29 AM
Points: 747,
Visits: 2,090
|
|
| I apologize for my oversight da-zero. I agree with you a 100% with the functionality of components for the SCD. How about using a checksum or even hashbyte value to determine a record condition? Similar to that of an incremental load.
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 2:11 AM
Points: 9,378,
Visits: 6,473
|
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Today @ 7:29 AM
Points: 747,
Visits: 2,090
|
|
Very nice. I have had to implement the check sum before. What I did was build a checksum value over the values of columns (in this case all of them) and performed and insert, update, delete based upon that value. I like your setup in your last post. However, I believe that we may be getting slightly off base of helping a fellow with his issue. Pleasure discussing strategy with you.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, September 09, 2011 2:30 AM
Points: 4,
Visits: 20
|
|
i'm agree for the SCD wizard, but i thought u wanted something different.
i have a real pleasure to read all that post on this subject :)
I didn't use the codeplex one, and the merge option as well, and actually for me, dimension should not contains millions rows :)
but i accept the fact that sometime, we don't have choices.

|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 2:11 AM
Points: 9,378,
Visits: 6,473
|
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Today @ 7:29 AM
Points: 747,
Visits: 2,090
|
|
Here is a link for Phil Brammer article on using the checksum component for ssis.
http://www.ssistalk.com/2007/03/09/ssis-using-a-checksum-to-determine-if-a-row-has-changed/
When I implemented the checksum, I did all of it from T-SQL. Allow me to explain -
1. I have a base and a staging table identical in schema. Data from my import is loaded into my staging table. On the staging table I have added an additional column (checksum value) that is a computed column contain a checksum over all of the columns of the staging table, with the exception of a few columns. As data is loaded into staging table, checksum value is computed on the fly.
2. Once data has been loaded into the staging table, I perform a comparison between the staging table and base table.
a. Delete - delete from base table where business key not exist in staging table.
b. Update - create a checksum value over the columns of base table and compare that checksum value and business key against the checksum value and the business key of the staging table. If not equal update, else ignore.
c. Insert - where business key not exist in base table.
If you like I could create a mockup of the syntax for you if that would make more sense. I am more of a visual person my self so sometimes this helps. A picture is worth a thousand words.
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 2:11 AM
Points: 9,378,
Visits: 6,473
|
|
Thanks for the link, very informative. However, at my current project I'm not allowed to install custom components, so yeah 
Correct me if I'm wrong, but to me it seems that the set-up that you outlined just makes a perfect copy of the staging table in the base table. (rows that are not in the staging table are deleted, rows that are not in the base table are inserted, changed rows are updated. Hence, you end up with the staging table).
Isn't it simpler to just truncate the base table, perform a load of the staging table and re-build indexes? (or did I miss something. That's possible, it's friday )
How to post forum questions. Need an answer? No, you need a question. What’s the deal with Excel & SSIS?
Member of LinkedIn. My blog at LessThanDot.
 MCSA SQL Server 2012 - MCSE Business Intelligence
|
|
|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Today @ 7:29 AM
Points: 747,
Visits: 2,090
|
|
| Business requirements state that I am not allowed to truncate the base table as it needs to available at all times. I will work on a mockup for you and post it.
|
|
|
|