sqlbulkcopy identity on sql server

If your local table definition does not match the server’s (it is missing the identity column), then you need to add an explicit mapping for each column (case-sensitive)

The first value is the name of the local source column, the second is destination column name.

bulk.ColumnMappings.Add("one", "one");
bulk.ColumnMappings.Add("two", "two");

This is also the case if the names don’t match up exactly.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top