Any idea if it's possible to get a list of the trouble making rows in an INSERT/UPDATE statement when a constraint test fails?
I'm trying to insert data with an SQLBulkCopy object reading data from a DataTable, and when the constraint fails I have no way of telling which rows caused the issue. The DataTable is quite large, and is actually data from an XML file so I can't really run a SELECT statement against that source to find rows that match the constraint's selection criteria.
Thx!
FYI Could not find a way to get this info from the framework, so built a helper class that can retrieve all the errors and related data rows when a SqlBulkCopy process fails. See here for details: http://www.codeproject.com/script/Articles/ArticleVersion.aspx?waid=13789&aid=387465