dbTalk Databases Forums  

Parsing numbers regardless of Regional Settings

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Parsing numbers regardless of Regional Settings in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thomas Kern
 
Posts: n/a

Default Parsing numbers regardless of Regional Settings - 02-16-2004 , 04:00 AM






I am importing numbers from a file. The numbers in the file always have the
following format:
"0,00" -> which means a comma is used as decimal separator.

During the import I multiply this number by 100. I do this using a VB
Transformation Script.

Now there is one problem with this:
As soon as SQL Server Agent is running under an account with Regional
Settings that define the "." as decimal separator I get wrong values,
because the script parses the number according to the Regional Settings.
What I need is to parse the number from the file, without taking the
Regional Settings into account.

How is this possible in VBScript?

rgds,
tom



Reply With Quote
  #2  
Old   
Mr Me
 
Posts: n/a

Default Parsing numbers regardless of Regional Settings - 02-16-2004 , 04:36 AM






Do a replace on the column before you multiply or simply
take away the decimal seperator before you multiply if
you know how many decimals are in the column and the
divide the number by for example 100 so you get the
decimal separator back in place.


Quote:
-----Original Message-----
I am importing numbers from a file. The numbers in the
file always have the
following format:
"0,00" -> which means a comma is used as decimal
separator.

During the import I multiply this number by 100. I do
this using a VB
Transformation Script.

Now there is one problem with this:
As soon as SQL Server Agent is running under an account
with Regional
Settings that define the "." as decimal separator I get
wrong values,
because the script parses the number according to the
Regional Settings.
What I need is to parse the number from the file,
without taking the
Regional Settings into account.

How is this possible in VBScript?

rgds,
tom


.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.