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
{{ message }}
Repository navigation
Bulk Copy Handles Decimal Inconsistently Compared with Normal Queries #457
Trying to insert into a Decimal column with the new bulk_copy can throw an exception regarding mismatched decimal scale, whereas a normal insert will succeed and automatically deal with the issue. I would like to see bulk_copy work similarly and seamlessly.
To reproduce
importmssql_pythonfromdecimalimportDecimalconn=mssql_python.connect([connstring], autocommit=True)
cur=conn.cursor()
cur.execute('create table dectest (d decimal(10, 2));')
# This next line works finecur.execute('insert into dectest values (?)', Decimal('123.456'))
# This line fails with the below exceptioncur.bulkcopy('dectest', (Decimal('123.456'),))
Activity
github-actions commentedon Feb 27, 2026
Hi Adam Machanic (@amachanic), thank you for opening this issue!
Our team will review it shortly. We aim to triage all new issues within 24-48 hours and get back to you.
If you have additional information to share, please feel free to update the issue.
Thank you for your patience!
saurabh500 commentedon Feb 28, 2026
Thanks. We were conservative in conversions in bulkcopy for Decimal. The feedback makes sense. We can alleviate this restriction.
amachanic commentedon Aug 7, 2026
Any updates here? Just hit this again today and had to work around. Kind of annoying. Would definitely appreciate a fix!