SolvedPrivate

Using the  Derived Column Transformation editor in an SSIS 2008 Data Flow

Posted on 2014-04-01
5
25 Views
Last Modified: 2016-02-10
Hi,
I am trying to replace  the following  string pattern
0 0 0 0

Open in new window

with NULLs  in an SSIS Data Flow. In a Derived Column Transformation I have entered the following expression
[MSTUB-xInt_Only-Rev-Dt] == " 0 0 0 0" ? NULL(DT_WSTR,10) : SUBSTRING([MSTUB-xInt_Only-Rev-Dt],5,4) + "-" + SUBSTRING([MSTUB-xInt_Only-Rev-Dt],3,2) + "-" + SUBSTRING([MSTUB-xInt_Only-Rev-Dt],1,2)

Open in new window

but the pattern is still getting through.
Any help appreciated. Thanks
0
Comment
Question by:blossompark
  • 5
5 Comments
 

Author Comment

by:blossompark
ID: 39971596
below is a grab of the Data VIewer showing the still present values
t
0
 

Author Comment

by:blossompark
ID: 39971639
Here is  the input and output to the transformation task
and the expression in the task used to filter this column
[MSTUB-xInt_Only-Rev-Dt] == "00000000" || [MSTUB-xInt_Only-Rev-Dt] == "0 0 0 0" || [MSTUB-xInt_Only-Rev-Dt] == "0 0- 0- 0" ? NULL(DT_WSTR,10) : SUBSTRING([MSTUB-xInt_Only-Rev-Dt],5,4) + "-" + SUBSTRING([MSTUB-xInt_Only-Rev-Dt],3,2) + "-" + SUBSTRING([MSTUB-xInt_Only-Rev-Dt],1,2)

Open in new window

ipop
0
 

Author Comment

by:blossompark
ID: 39971664
tried this also, result is the same as above
[MSTUB-xInt_Only-Rev-Dt] == "0" + " " + "0" + " " + "0" + " " + "0" ? NULL(DT_WSTR,10) : SUBSTRING([MSTUB-xInt_Only-Rev-Dt],5,4) + "-" + SUBSTRING([MSTUB-xInt_Only-Rev-Dt],3,2) + "-" + SUBSTRING([MSTUB-xInt_Only-Rev-Dt],1,2)

Open in new window

0
 

Accepted Solution

by:
blossompark earned 0 total points
ID: 39972416
USing TRIM solves the issue
TRIM([MSTUB-xInt_Only-Rev-Dt]) == "0 0 0 0" ? NULL(DT_WSTR,10) : SUBSTRING([MSTUB-xInt_Only-Rev-Dt],5,4) + "-" + SUBSTRING([MSTUB-xInt_Only-Rev-Dt],3,2) + "-" + SUBSTRING([MSTUB-xInt_Only-Rev-Dt],1,2)

Open in new window

0
 

Author Closing Comment

by:blossompark
ID: 39982471
USing TRIM solves the issue
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

My client has a dictionary table. They're defining a list of standard naming convention. Now, they are requiring my team to provide us a mechanism how to match new incoming data with existing data in their system.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
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

758 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

20 Experts available now in Live!

Get 1:1 Help Now