Solved

Datatype conversion in SSIS

Posted on 2014-02-03
3
232 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
3 Comments
 
LVL 65

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 10

Expert Comment

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

Open in new window

0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Here's a requirements document template for an integration project (also known as Extract-Transform-Load or ETL) based on my development experience as an SQL Server Information Services (SSIS) developer over the years.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 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

15 Experts available now in Live!

Get 1:1 Help Now