• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

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!

0
foreverdita
Asked:
foreverdita
1 Solution
 
imrancsCommented:
>>but everytime I change it to decimal or int or whatever

how you are changing, any sample code...


Imran
0
 
mastooCommented:
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.
0
 
foreverditaAuthor Commented:
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.
0
 
mastooCommented:
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?
0
 
mironCommented:
try to read this sql server on - line documentation article:
"Using decimal, float, and real Data"

-- cheers
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now