Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Convert Currency in SSIS


Convert Currency in SSIS

Author
Message
mbrady5
mbrady5
SSC-Enthusiastic
SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)SSC-Enthusiastic (131 reputation)

Group: General Forum Members
Points: 131 Visits: 759
Hello,

has anyone used SSIS to convert currency based on a date from a table?

For example;

If I have a table with the following Columns;


Amount Currency USDAmount InvoiceDate

1000 CAD NULL NULL

I would like to possibly use a free web service that will look at my Invoice Date and do the Math based on the Spot currency rate for that time and return the converted US Dollar amount.

Thanks
jm99
jm99
SSC-Enthusiastic
SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)

Group: General Forum Members
Points: 118 Visits: 297
My WSDL is not that strong but I would go along the lines of using a dataflow in the format:

Data source to get your data which feeds a script component synchronous transform which:

Set the input USDAmount column to read/write

In the PreProcess method sets up the WSDL

In the ProcessInputRow method pass the date, currency code and amount to the WSDL and uses the object attribute to apply the conversion to the currency value and store the result in the USDAmount column.

The performance will not be great since the web service will be called for each row.

If possible pre-sort your amounts by date and currency. This means that you can optimise the script component to only access the web service and get the exchange rate on a change of date and/or currency
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search