how getting numbers with 2 digits behind ,

  • I want numbers in my table with 2 digits behind the comma, like this:

    1 --> 1,00

    1,1 --> 1,10

    1,111 --> 1,11

    the problem is that I import this data with the wizard, in my excel-sheet from where I import, the numbers are with 2 digits after the comma, but when they are imported into sql server they are not. Can I change it in the design table? I tried the decimal type, but it didn't worked

  • What wizard? How do you want to store the values. Are they numbers (some locales use comma instead of full stop as decimal separator).

    If you want to store the values as decimal (numeric) then convert the commas to full stops as in

    DECLARE @test-2 numeric(9,2)

    SELECT @test-2 = REPLACE('1,111' , ',' , '.')

    SELECT @test-2

    Far away is close at hand in the images of elsewhere.
    Anon.

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

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