Identity in sqlbulkcopy

  • Thread starter Thread starter Shawn Ferguson
  • Start date Start date
S

Shawn Ferguson

How do you handle identity fields when using SqlBulkCopy ?

textfile - no identity to sql server identity field - only additional field in sql server.
 
It's giving me an error, column mapping not matching up with source. How can that be avoided?

How do you handle identity fields when using SqlBulkCopy ?

textfile - no identity to sql server identity field - only additional field in sql server.
If it is autoincrement SQL server will take care of it the same as it would if
you inserted it from SQL.
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
It's giving me an error, column mapping not matching up with source. How can that be avoided?



If it is autoincrement SQL server will take care of it the same as it would if
you inserted it from SQL.
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com

Make sure you didn't show a link to the primary key in the table. If you did,
the data will be one position off. If that's not the case, then I'm out of
ideas.

Anyone else seen this behavior?
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top