Link to home
Start Free TrialLog in
Avatar of foreverdita
foreverdita

asked on

Import Float data into SQL - need to keep the decimal places

I have an access table that I am importing into SQL - when I do, the columns come over as float, with the numbers like this:

1.2
3.5
etc.

I need to change it to a type that I can call and add through asp, but everytime I change it to decimal or int or whatever, it rounds the number up.

Please help, I need to keep the decimal places.

Thanks!

Avatar of imrancs
imrancs
Flag of Pakistan image

>>but everytime I change it to decimal or int or whatever

how you are changing, any sample code...


Imran
You're having trouble with rounding during the import, or after the import when you try to change the column data type?

Are you just not specifying a scaling when you change it to decimal?  You want a scale sufficient to hold the right number of digits to the right of the decimal point.  A default of 0 will cause it to behave as an integer.
Avatar of foreverdita
foreverdita

ASKER

OK, I import my access table into sql - the values change to float from access(number)

I then try to change the float to another type and it rounds the number no matter what.
How do you do that last step?  You're just going into Enterprise Manager, design table, and changing the data type to something like decimal with precision 18 and scaling 2?
ASKER CERTIFIED SOLUTION
Avatar of miron
miron
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial