Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8553295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:37:08+00:00 2026-06-11T14:37:08+00:00

In a SQL Server money column how can I deal with different currency notations

  • 0

In a SQL Server money column how can I deal with different currency notations coming in from country specific Excel files via SSIS (in varchar – transformed to money), taking care of comma and dot representation to make sure the values stay correct?

For example if these are three column values in Excel:

22,333.44

22.333,44

22333,44

the first notation above will result in 22,3334, which of course is incorrect.

What do I need to do with the data? Is it a string replace or something more elegant?

thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:37:10+00:00Added an answer on June 11, 2026 at 2:37 pm

    UPDATED:
    After discussion in comments the problem has been clarified. The values in the excel column can be of many different regional formats (English using commas to separate thousands and ‘.’ for decimal point, German using ‘.’ for separating thousands and comma for decimal point).

    Assuming that the destination format is English and you don’t have an accompanying column to indicate the format then you’re gonna have to implement a kludge of a workaround. If you can guarantee there will always be 2 numbers after the “decimal place” (comma in german format) then REPLACE(REPLACE(@Value,’,’,”),’.’,”) will get rid of every comma/point. Then you will have to get the length of the resulting varchar and manually insert a decimal (or comma) before the last 2 characters. Here’s a sample implementation:

    declare @number varchar(12),@trimmednumber varchar(12),@inserteddecimal varchar(12)
    set @number='22.333,44'
    select @trimmednumber=REPLACE(REPLACE(@number,',',''),'.','')
    select @inserteddecimal=(LEFT(@trimmednumber,len(@trimmednumber)-2) + '.' + RIGHT(@trimmednumber,2))
    select @number AS [Original],@trimmednumber AS [Trimmed],@inserteddecimal AS [Result]
    

    And the results:

    Original     Trimmed      Result
    ------------ ------------ ------------
    22.333,44    2233344      22333.44
    

    Original Answer:

    I may be misunderstanding your question but if you take in those values as VARCHAR and insert them into MONEY columns then the implicit conversion should be correct.

    Here’s what I’ve knocked together to test:

    declare @money_varchar1 varchar(12),@money_varchar2 varchar(12),@money_varchar3 varchar(12)
    set @money_varchar1='22,333.44'
    set @money_varchar2='22.333,44'
    set @money_varchar3='22333,22'
    declare @table table (Value money)
    insert into @table values (@money_varchar1)
    insert into @table values (@money_varchar2)
    insert into @table values (@money_varchar3)
    select * from @table
    

    And the results:

    Value
    ---------------------
    22333.44
    22.3334
    2233322.00
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I retrieve numeric/decimal/money column values from SQL Server database as SQL_NUMERIC_STRUCT structures. Now I
I have a Money column in my SQL Server 2008 table. In my below
I have a column type money in my sql server database, which is moneyAcumulated
I try to read numeric/decimal/money columns from SQL Server via ODBC in the following
Coming from an Oracle background I cannot believe how SQL Server is giving me
I couldn't find anything that rejects or confirms whether SQL Server 'MONEY' data type
I am connecting to an MS SQL Server db from Python in Linux. I
Using SQL Server. I am getting an error from an SQL Insert statement: The
I'm preparing to the SQL Server exam (70-431). I have the book from Sybex
I have a Money field in Sql server Table and mapping to double in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.