Solved

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

Posted on 2004-09-16
5
346 Views
Last Modified: 2011-04-14
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
Comment
Question by:foreverdita
5 Comments
 
LVL 10

Expert Comment

by:imrancs
ID: 12075054
>>but everytime I change it to decimal or int or whatever

how you are changing, any sample code...


Imran
0
 
LVL 21

Expert Comment

by:mastoo
ID: 12075236
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
 

Author Comment

by:foreverdita
ID: 12077331
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
 
LVL 21

Expert Comment

by:mastoo
ID: 12078439
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
 
LVL 9

Accepted Solution

by:
miron earned 500 total points
ID: 12080343
try to read this sql server on - line documentation article:
"Using decimal, float, and real Data"

-- cheers
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now