December 19, 2007 at 3:00 am
Hi all,
Im currently using bulk insert to import data from a flat file to a table in sql server., the import is fine and work as it should apart from ideally i would like to catch the errors thrown by individual rows from the import, without ending the insert.
Has anyone any ideas on how to do this?
Many Thanks,
Scott
December 19, 2007 at 1:47 pm
Your options are the create a SSIS package that dumps problem rows into an error file or you can use BCP to import and set the max errors to a larger value and have it dump into a file, with ERRORFILE = 'file_name'.
More info on BCP:
December 19, 2007 at 4:37 pm
Not that it matters, but I really like the BCP method... it's pretty darned fast, too. As Adam mentioned, it call also capture the bad rows in a separate file for rework.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply