Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 383
  • 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

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

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