[dba-SQLServer] Errors importing CSV

Mark A Matte markamatte at hotmail.com
Mon Jan 15 09:39:56 CST 2007


I do something similar...but my files are close to/over a gig and I can't 
open them with the text editors I have access to....so I link to the file 
with access to see the data in the messed up row, isolate the problem...then 
I use VBA to loop through chunks of the file, fix the isolated problem, and 
write the chunks out to a new file.  Might be aroundabout...but works.

Thanks,

Mark A. Matte


>From: "Stuart McLachlan" <stuart at lexacorp.com.pg>
>Reply-To: dba-sqlserver at databaseadvisors.com
>To: dba-sqlserver at databaseadvisors.com
>Subject: Re: [dba-SQLServer] Errors importing CSV
>Date: Mon, 15 Jan 2007 14:17:01 +1000
>
>First thing I'd do is open a problem CSV file in something like NoteTab or 
>Crimson Editor.
>Take a close look at the first line which is throwing a problem.
>That should tell you what is causing it and you can take necessary 
>corrective action.
>
>
>
>On 14 Jan 2007 at 23:04, JWColby wrote:
>
> > I have several machines.  One machine has SQl Server 2K installed, 
>another
> > has SQL Server 2005.  I have a bunch of largish csv files, with ~2.1 
>million
> > records each which I need to import.  The SQL Server 2K database has 
>always
> > been able to import these things in the past, in fact still can import a
> > certain subset of the files, but is consistently getting "missing field
> > delimiter" at some point in the majority of these files.  What record it
> > says is bad varies from file to file, but is repeatable (same record) in 
>any
> > given file.
> >
> > These same files import just fine in SQL Server 2005, no errors at all.
> >
> > Is 2005 simply more forgiving, automatically dropping any records which 
>have
> > missing field delimiters, or is 2K screwing something up?  I have done a
> > bunch of these imports and suddenly am having problems.  Any file with a
> > problem always has the problem, and any file that imports successfully 
>will
> > always import successfully so I suspect that there are actual bad rows 
>in
> > the files.
> >
> > IK am using the wizard in all cases, 2K and 2005
> >
> > John W. Colby
> > Colby Consulting
> > 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
>

_________________________________________________________________
Dave vs. Carl: The Insignificant Championship Series.  Who will win? 
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://davevscarl.spaces.live.com/?icid=T001MSN38C07001




More information about the dba-SQLServer mailing list