How to write the value with decimals before the point in the sql server?

2

I have a field in the bank with this format

TESTE   numeric(8, 3)     

I want to record this form.

UPDATE TB_PLANO_CONTAS SET TESTE = 001.000 WHERE  IDPLANOCONTAS = 63

The result looks like this: 1,000

UPDATE TB_PLANO_CONTAS SET TESTE = 101.000 WHERE  IDPLANOCONTAS = 64

The result looks like this: 101,000

    
asked by anonymous 13.11.2015 / 18:18

1 answer

1

This problem is occurring because the field created in SQL is numeric. Thus, the leading zeros are ignored. Even if you loop to insert the zeros, you will not be able to.

One way to do this is to change the numeric field to character, but then you have to see your need for the field type.

    
13.11.2015 / 19:00