Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SqlBulkCopy exceptions don't trigger DataSet.HasErrors

Status
Not open for further replies.

MuadDubby

Programmer
Sep 23, 1999
236
CA
Hi

Every now and then I run into cases where I'm doing a bulk copy and the it is terminated with an exception due to some primary key violation, foreign key violation, constraint violation, etc.

The violations are valid and need to be looked into, but what I can't figure out is why the DataTable or DataSet I'm using for the bulk copy never has the HasErrors property turned on when these exceptions occur. If it was on, I could drilldown to the individual DataRow that has the HasErrors flag turned on and quickly find the source of the problem.

A search on the net yelded very few answers on this. Looks like it is not even possible.

Anyone else ever run into this? Is it perhaps something you configure on SQL Server? I'm using SQL Server 2005, btw, and framework 3.5.

Thx!

MuadDubbby
 
Thx PRPhx, but no. I'm using the SqlBulkCopy class, as mentioned in the title. It might be using a regular bulk insert in the background, but I have not seen a way to pass an error file name to the bulk copier.

MuadDubbby
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top