You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using SQLServerBulkCopy to import a BigDecimal into a Numeric column the scale isn't checked.
If the column metadata is defined as a Decimal(10, 4) and then new BigDecimal("1").setScale(2, RoundingMode.HALF_UP) is passed the table will end up with a value of 0.01 instead of 1.0
I think it would be safer if the IOBuffer.writeBigDecimal was passed bulkScale by the SQLServerBulkCopy.writeColumnToTdsWriter method and then threw an exception when the bigDecimalVal.scale() differed from bulkScale
The text was updated successfully, but these errors were encountered:
When using
SQLServerBulkCopy
to import aBigDecimal
into aNumeric
column the scale isn't checked.If the column metadata is defined as a
Decimal(10, 4)
and thennew BigDecimal("1").setScale(2, RoundingMode.HALF_UP)
is passed the table will end up with a value of 0.01 instead of 1.0I think it would be safer if the
IOBuffer.writeBigDecimal
was passedbulkScale
by theSQLServerBulkCopy.writeColumnToTdsWriter
method and then threw an exception when thebigDecimalVal.scale()
differed frombulkScale
The text was updated successfully, but these errors were encountered: