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

Fix documentation for BulkInsert #9

Closed
OssiGalkin opened this issue Oct 20, 2021 · 0 comments · Fixed by #12
Closed

Fix documentation for BulkInsert #9

OssiGalkin opened this issue Oct 20, 2021 · 0 comments · Fixed by #12

Comments

@OssiGalkin
Copy link
Contributor

Documentation says "All object property names need to match with the destination table column names."

Looking from code it just uses https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlbulkcopy?view=dotnet-plat-ext-5.0

It won't use column mappings, which afaik should be used if column names would have any effect.

"If the data source and the destination table have the same number of columns, and the ordinal position of each source column within the data source matches the ordinal position of the corresponding destination column, the ColumnMappings collection is unnecessary. However, if the column counts differ, or the ordinal positions are not consistent, you must use ColumnMappings to make sure that data is copied into the correct columns." https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlbulkcopy.columnmappings?redirectedfrom=MSDN&view=dotnet-plat-ext-5.0#System_Data_SqlClient_SqlBulkCopy_ColumnMappings

-> check if instead of names, the amount and order needs to match and fix documentation if needed

@OssiGalkin OssiGalkin linked a pull request Dec 17, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant