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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

maxerrors and errorfile

Status
Not open for further replies.

bmpsu

Programmer
Jan 13, 2005
128
0
0
US
sql server 2005
vb.net

I have a vb.net program that imports data. There is a call to a stored procedure that uses a Bulk Insert Command. I am using the MAXERRORS and ERRORFILE Arguements. MAXERRORS = 10. If I do not reach the 10 errors, I want the bad records to write to my ERRORFILE.

This works. Lets say I only have 5 errors. My SP still returns the error message back to my VB program via (System.Data.SqlClient.SqlException). As well as creates my ERRORFILE with the 5 bad records.

If the max 10 errors are not met, I do not want to return any errors from the SP to my program. How can I do this?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top