This is a bug in SqlBulkCopy -- one of the internal queries it generates doesn't correctly handle quote characters in the table name. Unfortunately, doubling the quotes dosn't allow you to work around the problem, since other queries in the sequence ARE correctly handled (so you end up targetting different tables). I don't see a good workaround at the moment, other than to avoid quotes in the table name if you are going to use SqlBulkCopy.
One possible workaround: bulk copy into a temp table (that doesn't have a quote in the name), then INSERT SELECT from there into the destination table. Perf will suffer, so it may not be workable in your situation.
|