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

SqlBulkCopy - Improve granularity of exceptions due to data mismatches. #546

Closed
Korporal opened this issue Apr 30, 2020 · 5 comments
Closed

Comments

@Korporal
Copy link

Is your feature request related to a problem? Please describe.

When we call SqlBulkCopy.WriteToServer and there are rows that lead to insert exceptions (data lengths etc) the exception we see contains no information about the row number of the column.

Describe the solution you'd like

Report the row number and the column name in addition to the details of the mismatch.

Describe alternatives you've considered

Writing our own pre-validator.

Additional context

In one case we were attempting to insert 1,700,000 rows and we know that some column in some row was a problem but could not pin it down.

@cheenamalhotra
Copy link
Member

Hi @Korporal

We have addressed your concern in PR #437 and v2.0.0-preview2 contains this enhancement.
Please give that a try and let us know.

@cheenamalhotra
Copy link
Member

Closing due to inactivity and support provided with recent driver updates.

@Korporal
Copy link
Author

@cheenamalhotra Thanks for the effort put into this, very helpful change and I look forward to leveraging very soon!

@Korporal
Copy link
Author

Korporal commented Jun 4, 2020

@cheenamalhotra The app that was experiencing the original problem is built on .Net Framework 4.5.2 is this something we'll see as an update to .Net Framework or is it all .Net Core these days?

@cheenamalhotra
Copy link
Member

Microsoft.Data.SqlClient supports .NET Framework 4.6+ and the above PR also applies to the same.
We aim to provide fixes/improvements to .NET Framework target applications equally as .NET Core and Standard for smoother transition experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants