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!
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!
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.
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.
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
how you are changing, any sample code...
Imran