Pergunta

I got a table EMPLOYEE1 and i'm trying to insert values into it

INSERT INTO EMPLOYEE1 values(00001, 00004566)

But it inserts the values as 1 and 4566 truncating zero's why does this happen. can some one help me out

Foi útil?

Solução

This is happening because the data type of this column is numeric. You should make these columns varchar to be able to insert numbers without trancating zeros. Something like:

CREATE TABLE Employee1(EmpNumber VARCHAR(50), EmpName VARCHAR(50), ...);

INSERT INTO Employee1 VALUES
('00001', 'Foo', ..);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top