Convert varchar to decimal with coma separator

  • Hi all,

    If i run this sql sentence:

    select CONVERT(decimal (10,6),'1,5')

    I receive 'Msg 8114, Level 16, State 5, Line 1'

    Error converting data type varchar to numeric.

    But if i run the next:

    select CONVERT(decimal (10,6),'1.5')

    It run correctly. The only difference is the decimal point separator. With ',' (coma) it failed, but with '.' (point) run correctly.

    How i can use the ',' decimal separator when convert varchar to decimal? Is there any option or in sql server i only can convert from varchar to decimal using '.' (point) decimal separator?

    Many thanks in advance.

  • unfortunately it is not supported .

    You will have to use replace to convert to the 'us-english' standard on using a fullstop.

    Vote up this item

    http://connect.microsoft.com/SQLServer/feedback/details/126363/escape-character-for-decimal-point



    Clear Sky SQL
    My Blog[/url]

  • Thanks Dave.

  • This was removed by the editor as SPAM

  • Thanks all for your help.

Viewing 5 posts - 1 through 4 (of 4 total)

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