By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,379 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,379 IT Pros & Developers. It's quick & easy.

SSIS and HEX conversion.

P: 14
I must convert a CSV file which is simply hexadecimal words. There is a SSIS function to convert from decimal to hex but none for either hex to decimal or hex to ASCII.
Here is what my file looks like:

Here is what it should give:

I already started a DataFlow task which seperates each hex combo into different columns and get rid of the semicolons. The next step would have been to convert each column contain into ASCII digits but to my surprise, there is no function to do that.

Is there a way to:
- Create my own SSIS function and use it in the Derived Column tool.
- Process all rows given by my DataFlow task into C# or VB?

Or maybe I'm just doing this wrong from the start.

Any thoughts?
May 1 '08 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 2,878
Can CONVERT() handle it?

-- CK
May 1 '08 #2

P: 14
Can CONVERT() handle it?

-- CK
I can't seem to find CONVERT() in the list of SSIS functions. What I did was to create an Script Component (duh!) and convert each column using VB code. I just wish I could find a more user-friendly solution.

Here is the VB code (thanks to google):
Row.Digit1 = Chr(CInt(Val("&H" & Row.Digit1.ToString()))) 'Digit1 is the name of the column

The CInt function was recommended by VS auto-corrector(??). Without it I had this error: "Option Strict On disallows implicit conversions from 'Double' to 'Integer'." I must admit I don't know why but it works so, what the hell!

Can I use C# code in an SSIS script?
May 1 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.