I have two tables. One is temp table and another is main table. In temp table, I have a column called "Contract Number" which is of "float" datatype. In Main table, I have a same column "Contract Number" but with "varchar(50)" datatype.
In Temp table, the Contract Number column has a value "40494318". When I insert into the Main table the value changes into "4.04943e+007".
I used the query,
INSERT INTO Temp_Contract (Contract_Num)
Select Contract_Num From Main_Contract
Please help me how to insert the values correctly.
If you're sure Contract_Num is always an integer:
INSERT INTO Temp_Contract
(Contract_Num)
SELECT CAST(Contract_Num AS INT)
FROM Main_Contract