"," used as a decimal separator

  • Hi all

      For some countries the decimal separator is a comma rather than the ".". Sql Server does not recogonise the same and errors out. We have a front end which passes values to the database as comma separated decimal number.

    For eg 10.5 is passed as 10,5

    How can SQL Server be configured to handle "," as the decimal separator.

     

    Rgds

    Kudla

     

  • no can do.

    Structured Query Language (SQL) uses a comma as a separator and not as a decimal sign.

    You can avoid this problem by not using sql-strings to pass to the db-server, but use command-objects (e.g. a stored proc or parameterized queries) which have parameters. Assign the values to the parameters and then execute the command.

    It is a front-end problem which should be handled front-end.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Why can't you simply replace "," with "." before passing the value to SQL?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply