Skip to content

Conversation

johnnypham
Copy link
Contributor

@johnnypham johnnypham commented Apr 24, 2020

For #23

ORDER ( { column [ ASC | DESC ] } [ ,... n ] ) Specifies how the data in the data file is sorted. Bulk import performance is improved if the data being imported is sorted according to the clustered index on the table, if any. If the data file is sorted in a different order, that is other than the order of a clustered index key or if there is no clustered index on the table, the ORDER clause is ignored. The column names supplied must be valid column names in the destination table. By default, the bulk insert operation assumes the data file is unordered. For optimized bulk import, SQL Server also validates that the imported data is sorted.

insert bulk, which SqlBulkCopy uses, will return an error message when an ORDER hint is given for an identity column and the query is not executed. This differs from BULK INSERT, which ignores the ORDER hint but still executes the query.

@johnnypham johnnypham added the Public API 🆕 Issues/PRs that introduce new APIs to the driver. label Apr 24, 2020
@dnfclas
Copy link

dnfclas commented Apr 24, 2020

CLA assistant check
All CLA requirements met.

@DavoudEshtehari DavoudEshtehari self-requested a review April 28, 2020 02:40
@cheenamalhotra cheenamalhotra added this to the 2.0.0 milestone May 4, 2020
@cheenamalhotra cheenamalhotra merged commit 1be606c into dotnet:master Jun 10, 2020
@johnnypham johnnypham deleted the bulkCopyOrderHints branch June 10, 2020 18:37
karinazhou pushed a commit to karinazhou/SqlClient that referenced this pull request Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Public API 🆕 Issues/PRs that introduce new APIs to the driver.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants