Re: pulling csv data into sql server
From: B. Hoskinson (BHoskinson_at_discussions.microsoft.com)
Date: 03/03/05
- Next message: Mary Chipman [MSFT]: "Re: 'connection failed'"
- Previous message: Igor Shekalev: "Re: S1010 error."
- In reply to: shriop: "Re: pulling csv data into sql server"
- Next in thread: shriop: "Re: pulling csv data into sql server"
- Reply: shriop: "Re: pulling csv data into sql server"
- Messages sorted by: [ date ] [ thread ]
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
>
>
- Next message: Mary Chipman [MSFT]: "Re: 'connection failed'"
- Previous message: Igor Shekalev: "Re: S1010 error."
- In reply to: shriop: "Re: pulling csv data into sql server"
- Next in thread: shriop: "Re: pulling csv data into sql server"
- Reply: shriop: "Re: pulling csv data into sql server"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|