Solved

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

Posted on 2004-09-16
5
365 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how the fundamental information of how to create a table.

687 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