runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Plain zero insertion error when SqlBulkCopy

Open geleems opened this issue 9 years ago • 1 comments

SqlDecimal 0 has precision 1 scale 0. When the scale is adjusted by n (n>0), currently, n is just added up to both prevision and scale, which makes precision 1+n and scale 0+n. Adjusting scale by 2 converts SqlDecimal 0 (precision 1, scale 0) into 0.00 with precision 3 and scale 2. This caused an issue on SqlBulkcopy, when a row with SqlDecimal 0 in DataTable was being inserted to a table which has decimal(2,2) type in the corresponding column.

geleems avatar Aug 03 '17 20:08 geleems

The bug was fixed: https://github.com/dotnet/corefx/pull/22926

geleems avatar Aug 09 '17 19:08 geleems