April 22, 2004 at 7:43 am
Is there an easy way to reject rows using bulk insert in for it to continue inserting regardless of some bad data?
For instance (sample 1)
1,224,20
1,225,30
1,corrupttext,20 <--- needs to be rejected due to incorrect datatype column 2
1,320,20
sample 2:
1,224,20
1,225,30
1,3 <--- needs to be rejected due to improper EOF
I hava used MAXERRORS but it does not take care of these issues.
Any help will be appreciated.
April 22, 2004 at 3:56 pm
^^ bump
no one?
April 22, 2004 at 7:20 pm
It's a forum, not on-line help...
Anyway, use the -m parameter followed by the number of errors you wish to allow. Lookup BCP,Overview in Books-on-line for more information about BCP Parameters. You can do some wonderful things with BCP including capturing the errors passed over in an error file for troubleshooting and repair.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 23, 2004 at 7:08 am
yes, I have used BCP and I do use it every day.
The problem is that we have production procedures running under VBscript, which runs sql (opening a connection to the db). I am not sure if it will be easy to change BULK INSERT with BCP. The processes insert into a #temp table, which as you know is used by the running instance only.
April 23, 2004 at 9:06 pm
In that case, Bulk Insert has a MAX ERRORS setting that works just like the BCP -m parameter. Again, check BOL under Bulk Insert.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 26, 2004 at 7:19 am
As I specified before, MAXERRORS does not do the trick.
I already checked BOL; seems that there is no other option available.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply