Skip to content

Bug: Incorrect syntax near the keyword 'WITH' BulkMergeAsync #640

@stefandevo

Description

@stefandevo

I tried

var mergedRows = await connection.BulkMergeAsync(syncConsumers, batchSize: 1000, hints: SqlServerTableHints.NoLock, bulkCopyTimeout: 300);

This caused

System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near the keyword 'WITH'.
Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
Incorrect syntax near the keyword 'AS'.

If I remove the hints then it worked. Note that I used the same hint for the BulkInsert command with success.

Is there an option to get the last generated SQL statement in such cases to further see what could be wrong?

BTW: Great lib!

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdeployedFeature or bug is deployed at the current releasefixedThe bug, issue, incident has been fixed.for grabsA community can grab for contribution

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions