We help IT Professionals succeed at work.
Get Started

Problem with FindString IN SSIS

4,370 Views
Last Modified: 2013-11-27
Hi Experts, I have an SSIS Package that is loading an Excel file into an SQL Server Table.
However I do have a problem with one column.

On my source Excel file I have a Column called "ProductsInNeed" and the datatype is like (DT_WSTR with a length of 255)
and the values in that column are like

"Toner,Ink,computer,printer,phone,power"
"printer,Ink,Toner,"
"computer,Toner,phone,power"
""
"computer,printer"

On my Target Table I have 6 columns like
"TonerWanted","InkWanted","computerWanted",
"printerWanted","phoneWanted","powerWanted"
All columns are with Datatype Varchar with a length 255.

What I have to do is like I need to check for a string in the incoming column
for example

If I have a string "Toner" in the source column then I need to send That to the Target Column
"TonerWanted" or else I need to send in a NULL

For this I have written an expression in DerviedColumn Like this

TRIM(FINDSTRING(ProductsInNeed,"Toner",1) == 0 ? "Toner" : (DT_STR,255,1252)NULL(DT_STR,255,1252))

But I am getting an error Like this

[OLE SRC [1]] Error: There was an error with output column "ProductsInNeed" (3112) on output
"OLE DB Source Output" (11). The column status returned was:
"Text was truncated or one or more characters had no match in the target code page.".

Any help on this will be Highly Appreciated.... Thanks In Advance
Comment
Watch Question
Top Expert 2010
Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE