Solved

Datatype conversion in SSIS

Posted on 2014-02-03
3
238 Views
Last Modified: 2016-02-10
Hi,

   I am trying to convert a salary field (coming from a comma delimited txt file) into an int so that I can compare it to 20000 in a SSIS conditional split condition.
What I do in the conditional split is this:
Cast([Salary] as int) > cast(20000 as int)

However, I keep getting this error in the attatchment. How can i convert my text field Salary to an int and then compare to 20K?

thx
0
Comment
Question by:LuckyLucks
[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 Comments
 
LVL 66

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 39831234
No attachment.

>How can i convert my text field Salary to an int
Derived Column task, create a new column,
   Derived Column = Replace 'the text column name'.
   Expression of (DT_I4) [the text column name].  
Then in downstream Conditional Split use the new column.
0
 
LVL 25

Expert Comment

by:jogos
ID: 39831260
Error in attachement?

You must see that all input-record have valid input.  The IsNumeric()-function can be usefull to filter the invallid records out first. What to do with the others depends on your process: neglect with or without (I hope not) error, putting dummy 0 in the place ...
0
 
LVL 11

Expert Comment

by:HuaMinChen
ID: 39831394
Try
Cast(replace([Salary],',','') as int) > cast(20000 as int)

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

690 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