round vs truncate sql vs c# RRS feed

  • Question

  • I have a numeric column in a table defined as numeric (9,4)

    When I insert a higher precision floating point number - the number ends up being rounded to the nearest 4th decimal digit - which is as predicted.

    However  - when using a C# application that creates a "row" in memory and then uses sqlBulkInsert to enter the rows - the number that was written to that column gets the value truncated to the 4th digit - and not rounded, causing a loss of precision.

    What's the best way to not have that happen?

    • Moved by Bob Beauchemin Tuesday, March 26, 2013 7:02 PM Moved to the forum for SqlBulkInsert for best response
    Tuesday, March 26, 2013 4:14 PM


All replies