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

Posted on 2004-09-16
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:


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.


Question by:foreverdita
LVL 10

Expert Comment

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

how you are changing, any sample code...

LVL 21

Expert Comment

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.

Author Comment

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.
LVL 21

Expert Comment

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?

Accepted Solution

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

-- cheers

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how the fundamental information of how to create a table.

914 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

17 Experts available now in Live!

Get 1:1 Help Now