Re: pulling csv data into sql server

From: B. Hoskinson (BHoskinson_at_discussions.microsoft.com)
Date: 03/03/05


Date: Thu, 3 Mar 2005 04:25:02 -0800

the only field that ever causes me any trouble is the first date field and
that is only because it is the only one that has a chance of throwing an sql
exception. if i could test this field to makesure that the data entered was
a real date before i begin iterating through the csv file to update the
databast that is what i want to do. inform the user that there is a problem
with the file and on what record so it can be corrected and they can rerun
their batch after correcting the error. as it stands when a bad date hits the
sql server asp.net tosses up an error page but only after it parses an
undeturmined number of lines in the csv and updates the database with those
lines. the users are horrible with computers. they put in a batch number t
oinitiate this process and nothing more so spliting up the file would not
work or be very effecient. even if it notified me that a file with bad
records was created. any sugestions on at least checking the singular date
field for a good date then, if there are no errors, updating the database
with the file, else inform the user of the eror and it's location.

"shriop" wrote:

> You're never going to be guaranteed full handling of all csv situations
> that can arise in the csv format unless you use a component that
> handles all of this for you. The best way is to use a csv parsing
> component that can read over a file line by line, you can do your
> checks, then save good lines out to another file, and possibly bad
> lines out to another file to edit. I've got a component that can do
> this for you, but unfortunately, it's not free, but would make this
> task horribly simple for you. It's cheap, and I have a demo version for
> people to try it out. http://www.geocities.com/shriop/index.html
>
>



Relevant Pages

  • Re: starting with OpenOffice base
    ... How am I to import a .csv ";" separated text file into base? ... 1.Export the desired data from the source database in a text format. ... 3.This opens the Export of text files dialogue box, ...
    (comp.os.linux.misc)
  • Re: starting with OpenOffice base
    ... How am I to import a .csv ";" separated text file into base? ... To exchange data in a text format use the OpenOffice.org Calc import/export filter. ... 1.Export the desired data from the source database in a text format. ... Once the data is in a OpenOffice.org Calc spreadsheet, you can edit it as needed. ...
    (comp.os.linux.misc)
  • Annoying Invalid path message from Link Specification
    ... no error message about the link specification ... I re-open the database, the linked table is there, now ... In trying to solve this problem, I tried opening the csv file with Access ...
    (microsoft.public.access.externaldata)
  • Re: How do I import DOS files into Excel?
    ... The old database is running on a machine. ... to try the CSV thing. ... data from the old program into a common format, ... John Nurick [Microsoft Access MVP] ...
    (microsoft.public.access.externaldata)
  • Re: Synchronize Treo650 palm cellphone pda with flat ASCII csv text file
    ... To sync, you need at least 3 more items in your text csv database: ... An exact mapping from text csv field to Palm address record field. ...
    (comp.sys.palmtops.pilot)

Loading