zillow / ctds

Python DB-API 2.0 library for MS SQL Server
MIT License
84 stars 12 forks source link

Bulk insert fails with small floats #93

Open seandickert opened 2 years ago

seandickert commented 2 years ago

I've encountered an odd issue with the bulk_insert function. The function fails when inserting values with scale >= 4 and 4 leading 0s. For example,

ctds.SqlDecimal(.000183, 23, 10)

will work, while

ctds.SqlDecimal(.000083, 23, 10)

fails. It could possibly have something to do with python representing floating point numbers in scientific notation when the # of leading 0s after the decimal is >= 4.