Solved

Using conditional split in SCD Type 1 change

Posted on 2013-01-15
6
804 Views
Last Modified: 2016-02-11
Hi,

I am trying to implement SCD T ype1 change using lookup and conditional split in SSIS

I am using lookup and conditional split in my SSIS  package to spilt data between
match and non matched rows.
Non matched rows are inserted into the target table as new rows , while the matched rows are passed through conditional split to check if the source fields is different from target field and if it finds such an entry it updates the target files value with the source value.

source.column != lookup.column

while the above expression does not check for null values in the columns, i use the below expression to handle it if fields are of  integer data type

(isnull(source.column_name) ? 0:source.column_name)) != (isnull(lookup.column_name) ? 0 :lookup.column_name)


for non integer columns(eg:datetime,varchar,text)

i use data conversion to change the datatype to string and then with conditional split i use the below expression to check nulls and unmatched values for the fields

(isnull(source.column_name) ? "" : source.column_name)) != (isnull(lookup.column_name) ? "" :lookup.column_name)

However i am not able to check null values with fields having ntext datat type
I tried converting the datatype to DT Wstr but it does not wrk

Please advise. how to check for null values in the columns with ntext data type
0
Comment
Question by:Sonali Paradkar
[X]
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
  • 3
  • 2
6 Comments
 
LVL 40

Expert Comment

by:lcohan
ID: 38782796
Did you ever thought about writing your own SQL code insteaqd and use new MERGE functionality? In my opinion this is more open to you and manageable comparing to SSIS.
You could still run it in SSIS sql step obviously

http://technet.microsoft.com/en-us/library/bb510625(v=sql.100).aspx
0
 
LVL 2

Accepted Solution

by:
thatmsftbuguy earned 500 total points
ID: 38784192
A Couple of Options

1. You can use the SCD Task in SSIS which will save you quite a few steps in setting up  the split between new records and updating records. It works quite well for SCD-1 changes. I am not a fan of using it for SCD-2 changes due to performance issue.

2. If you want to continue using what you have built, then convert DT_NText is your data conversion task. That datatype is applicable to ntext datatype in SQL Server
0
 

Author Comment

by:Sonali Paradkar
ID: 38784505
Well i did use data conversion for ntext column to  use DT_NText and then with the below expression
tried to check for nulls in the source and target  with conditional split but it  it does not work and errors out.

(isnull( new source.column_name) ? "":new source.column_name)) != (isnull(new lookup.column_name) ?"" :new lookup.column_name)

Please advise if the expression needs to be changed for this to work.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 2

Expert Comment

by:thatmsftbuguy
ID: 38784734
What Error are you getting. Can you post the error ????
0
 

Author Comment

by:Sonali Paradkar
ID: 38784882
Hi.

When i write the expression in the conditional split component it does not parse the condition.
This is the error i get. The column "description" is of type ntext and i have used data conversion to change its type to DT_NText and then then passed the field to conditional split  with the below expression.

(isnull( new source.column_name) ? "":new source.column_name)) != (isnull(new lookup.column_name) ?"" :new lookup.column_name)

Snapshot of the error is attached .

Please advise.

Thanks
error.jpg
0
 

Author Comment

by:Sonali Paradkar
ID: 38784960
Oh..k..i think i got it working it does work with ntext datatype and using data conversion, the only thing different i did in the expression in the conditional split was an extra bracket around the expression

(    (isnull( new source.column_name) ? "":new source.column_name)) != (isnull(new lookup.column_name) ?"" :new lookup.column_name)    )
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
query optimization 6 30
Finding Where Clause Value in SQL Views and SP 21 60
SSIS Connect to Rest Service URL 2 14
What does "Between" mean? 6 42
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

737 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