SolvedPrivate

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

Posted on 2014-04-01
5
28 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL query and VBA 5 45
MS SQL SERVER and ADODB.commands 8 18
SQL Recursion 6 16
SQL Recursion schedule 13 14
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

840 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