Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved decimal scale conversion #470

Conversation

DavoudEshtehari
Copy link
Contributor

@DavoudEshtehari DavoudEshtehari commented Mar 16, 2020

Before this change, the decimal data scale implicitly was truncated. And now, it is rounding as same as Microsoft SQL Server.
For backwards compatibility, you can add the 'Switch.Microsoft.Data.SqlClient.TruncateScaledDecimal' switch inside the AppContext with the value 'true'.

@DavoudEshtehari DavoudEshtehari force-pushed the ScaledDecimalParameterImprovement branch from d3dc447 to 6cf9b90 Compare March 17, 2020 21:36
For SqlParameter and SqlBulckCopy
@DavoudEshtehari DavoudEshtehari force-pushed the ScaledDecimalParameterImprovement branch from 6cf9b90 to d7d8e22 Compare March 19, 2020 00:09
DavoudEshtehari and others added 2 commits March 18, 2020 17:12
Co-Authored-By: David Engel <dengel1012@gmail.com>
Co-Authored-By: David Engel <dengel1012@gmail.com>
@cheenamalhotra cheenamalhotra added the 🆕 Public API Issues/PRs that introduce new APIs to the driver. label Mar 20, 2020
@DavoudEshtehari DavoudEshtehari force-pushed the ScaledDecimalParameterImprovement branch 3 times, most recently from 8442fe3 to 878bebc Compare March 23, 2020 18:22
@DavoudEshtehari DavoudEshtehari force-pushed the ScaledDecimalParameterImprovement branch from 878bebc to de3dced Compare March 23, 2020 18:55
@cheenamalhotra cheenamalhotra added this to the 2.0.0-preview3 milestone Mar 24, 2020
@DavoudEshtehari DavoudEshtehari force-pushed the ScaledDecimalParameterImprovement branch from 09095db to 549c62d Compare April 2, 2020 03:27
Changed Microsoft.Data.SqlClient.TruncateScaledDecimal to Switch.Microsoft.Data.SqlClient.TruncateScaledDecimal for unification.

Merge branch 'master' of https://github.com/dotnet/SqlClient into ScaledDecimalParameterImprovement
# Conflicts:
#	BUILDGUIDE.md
@DavoudEshtehari DavoudEshtehari force-pushed the ScaledDecimalParameterImprovement branch from 5f0d30c to 069aa9f Compare April 2, 2020 19:24
@cheenamalhotra cheenamalhotra added the 🔨 Breaking Change Issues/PRs that are related with breaking API changes in the driver. label Apr 3, 2020
@DavoudEshtehari DavoudEshtehari merged commit 0b8d7b5 into dotnet:master Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 Breaking Change Issues/PRs that are related with breaking API changes in the driver. 🆕 Public API Issues/PRs that introduce new APIs to the driver.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decimal parameters are truncated when precision and scale are set
5 participants