[dba-SQLServer] BCP error too generic

Stuart McLachlan stuart at lexacorp.com.pg
Wed Oct 14 14:21:18 CDT 2009


If it's a delimited text file, I'd build my own pre-procesor to check and possibly clean up the 
file.

Something to:
Read in a line.
SPLIT it into an array 
Check the number of fields using UBOUND
Step through the fields validating as necessary.
As a minimum, log the faulty line number and errors encountered.

You could knock something up to to do this in Access in five minutes,

If you want something to do it a lot faster for the big files in your database friom hell, send 
me a copy of your final Access procedure and I'll build a PBWin app for you to do the same 
thing in a fraction of the time.

Cheers,
Stuart


On 14 Oct 2009 at 9:43, jwcolby wrote:

> Yea, I saw this and about 47 million other posts for this error message.  It appears that if 
> ANYTHING (and I do mean ANYTHING) goes wrong in the import, BCP fails with this error message.  The 
> data I am trying to import is just full of trash.  empty fields, rows without the correct number of 
> fields etc.  It is no wonder BCP complains.
> 
> I was just hoping to get more info but it seems that is a dream.
> 
> John W. Colby
> www.ColbyConsulting.com
> 
> 
> Martin Reid wrote:
> > http://blog.cybner.com.au/2007/09/cannot-fetch-row-from-ole-db-provider.html
> > 
> > 
> > 
> > Martin WP Reid
> > Information Services
> > The Library at Queen's
> > Tel : 02890976174
> > Email : mwp.reid at qub.ac.uk
> > ________________________________________
> > From: dba-sqlserver-bounces at databaseadvisors.com [dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby [jwcolby at colbyconsulting.com]
> > Sent: 14 October 2009 14:03
> > To: Dba-Sqlserver
> > Subject: [dba-SQLServer] BCP error too generic
> > 
> > I am getting a failure to import (BCP) some line in a file.  When that happens the process just
> > fails with an error
> > 
> > "cannot fetch a row from OLE DB provider "BULK" for linked server "(null)"
> > 
> > Is there any way to get the row number that triggered the failure?  Or anything else even slightly
> > more useful than this pretty darned useless error message?
> > 
> > --
> > John W. Colby
> > www.ColbyConsulting.com
> > _______________________________________________
> > dba-SQLServer mailing list
> > dba-SQLServer at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> > http://www.databaseadvisors.com
> > _______________________________________________
> > dba-SQLServer mailing list
> > dba-SQLServer at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> > http://www.databaseadvisors.com
> > 
> > 
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
> 





More information about the dba-SQLServer mailing list