Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to use the case function in Derived Column

Status
Not open for further replies.

ginaburg

Technical User
Jul 14, 2004
62
0
0
US
Im using SSIS 2012.
This is the expression that I have on my field. The paymethod field is char field of length 1
I am trying to say if it = C then put "CHK else "EFT. How can I write this expression when I want the output to be 3 char.
The following give me an error
[Flat File Destination [35]] Error: Data conversion failed. The data conversion for column "PayMethod" returned status value 3 and status text "Text was truncated or one or more characters had no match in the target code page.".

(DT_STR,3,1252)(PayMethod == "C" ? "CHK" : "EFT")

If I do it like this it works but I need the "CHK" and "EFT"
(DT_STR,1,1252)(PayMethod == "C" ? "C" : "E")
 
did you tried (DT_STR,3,1252)(PayMethod == "C" ? "CHK" : "EFT") ?

 
You may have to trace your data all the way through the package to find where this is having a problem. I would start by looking at the flat file connection manager, on the Advanced tab, and verify my data types and sizes were good there.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top