locked
point after decimal wont count in sql server 2012 RRS feed

  • Question

  • hi there,

    i am transferring data from ms access 2013 to sql server 2012 using ssis package the problem i am facing is my access data contain point values but when my packaged transferred to sql server it won't count decimal point value . for ex value in my accesss database is like 19.32 but value in sql database is 19 only that different makes my data wrong.

    datatype im using in sql table is numeric(18,0) allow null

    datatype in access database is number

     

    Sunday, July 10, 2016 4:03 PM

Answers

  • Good day,

    Make sure that the column type is decimal or float and not int. The value 19.32 become 19 if the type of the column is int since 19.32 rounded down to the integer value.

    * By the way, you should understand the different between decimal and float in order to choose the best option for your case. I recommend to search Google for this: SQL Server decimal vs float


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]


    • Edited by pituachMVP Sunday, July 10, 2016 5:11 PM
    • Marked as answer by Eric__Zhang Monday, July 25, 2016 12:33 AM
    Sunday, July 10, 2016 5:08 PM
  • datatype im using in sql table is numeric(18,0) allow null 

    Data type numeric(18,0) indicates a precision of 18 total digits and a scale of zero, meaning no digits to the right of the decimal.  If you need to store 2 decimal positions, specify a scale of 2:  numeric(18,2).


    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    • Proposed as answer by pituachMVP Sunday, July 10, 2016 8:00 PM
    • Marked as answer by Eric__Zhang Monday, July 25, 2016 12:33 AM
    Sunday, July 10, 2016 6:28 PM

All replies

  • Good day,

    Make sure that the column type is decimal or float and not int. The value 19.32 become 19 if the type of the column is int since 19.32 rounded down to the integer value.

    * By the way, you should understand the different between decimal and float in order to choose the best option for your case. I recommend to search Google for this: SQL Server decimal vs float


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]


    • Edited by pituachMVP Sunday, July 10, 2016 5:11 PM
    • Marked as answer by Eric__Zhang Monday, July 25, 2016 12:33 AM
    Sunday, July 10, 2016 5:08 PM
  • datatype im using in sql table is numeric(18,0) allow null 

    Data type numeric(18,0) indicates a precision of 18 total digits and a scale of zero, meaning no digits to the right of the decimal.  If you need to store 2 decimal positions, specify a scale of 2:  numeric(18,2).


    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    • Proposed as answer by pituachMVP Sunday, July 10, 2016 8:00 PM
    • Marked as answer by Eric__Zhang Monday, July 25, 2016 12:33 AM
    Sunday, July 10, 2016 6:28 PM