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

how to trap row errors ona bulk insert

Status
Not open for further replies.

bebblebrox

IS-IT--Management
Aug 9, 2004
39
0
0
US
Hi,

So I'm trying to embrace the "cursors are evil" mentality while doing some dataloads. My question is this:

Say I'm inserting 10 rows from a query into a table. The first 9 have no problems, but the last has an error because it has a null value, or an arithmetic overflow, or whatever. how do I trap that error such that the other 9 get inserted?

 
Use DTS and in the transform tab, you are able to set the number of error that can be encountered before the insert operation, in this case, fails.

Thanks

J. Kusch
 
Also, look up @@Error in BOL. It can be used in regular T-SQL statements.



Catadmin - MCDBA, MCSA
"If a person is Microsoft Certified, does that mean that Microsoft pays the bills for the funny white jackets that tie in the back???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top