dotnet / dotnet/SqlClient

Add SqlBulkCopyOptions.AnsiWarnings Property

Open
#3,669 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
989
Forks
340
Avg merge
4d 19h
Merged PRs (30d)
72

Description

### Is your feature request related to a problem? Please describe.
When SqlBulkCopy is used to write string data too long for the target column the WriteToServer failed saying data are truncated.
It is not possible (as far as i know) to set another behavior (pass without failing and truncate the string like with an SET ANSI_WARNINGS OFF;)

### Describe the solution you'd like
It would be great to have a SqlBulkCopyOptions (like SqlBulkCopyOptions.AnsiWarnings) that can be disabled (or off) in order to mimic the SET ANSI_WARNINGS OFF behavior

### Describe alternatives you've considered
alternative need to get info about the target table and it's columns to cut the data at source using the length of the target. It is painfull.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.