Re: Bulk inserts into SQL Server 2000 from Flat Files
- From: "Jeff Jarrell" <jjarrel_NOSPAM@xxxxxxxxx>
- Date: Tue, 21 Feb 2006 20:18:11 -0500
BulkCopy is the way to go. While you may not be able to do it the "best
way" as David's Brown's post suggests because of your product versions. I
haven't kept up but what I have done this in the past, write a preprocessor
to convert the incoming flat file to another flat file (and create the
bcp.fmt file) that is more hospitable to bcp. Then shell out and run
bcp.exe. It sounds like a lot with the extra transform but it won't hurt
you like inserting one record at time into SQL will.
(bcp.exe is a command line utility that comes with the mssql tools).
"Jason Allred" <Jasonthemasonkcch@xxxxxxxxxxxxxxxxx> wrote in message
news:eiSuoVzNGHA.3936@xxxxxxxxxxxxxxxxxxxxxxx
This is my first post, so if this has been addressed before, please excuse
my ignorance...
I'm writing a Window's Service in VB.NET to take information from flat
files that contain GPS information and subsequently save them to a SQL
Server (2000) database. I have created classes / collections that do all
the work of retrieving the information from the flat files. That seems to
have been the easy part. Now in trying to get them into the DB, (just one
table), I find that creating several thousand insert statements is very
unwieldy, and results in records getting dropped. I've looked at creating
a dataset, but haven't found any examples online that I could twist to my
purposes yet.
The main problem I seem to be having is first getting the information from
the objects into a dataset, and then subsequently into the database. Does
anyone have any advice.
Regards,
Jason.
.
- References:
- Bulk inserts into SQL Server 2000 from Flat Files
- From: Jason Allred
- Bulk inserts into SQL Server 2000 from Flat Files
- Prev by Date: Re: Bulk inserts into SQL Server 2000 from Flat Files
- Next by Date: RE: Sql Server SCOPE_IDENTITY()
- Previous by thread: Re: Bulk inserts into SQL Server 2000 from Flat Files
- Next by thread: RE: Bulk inserts into SQL Server 2000 from Flat Files
- Index(es):
Relevant Pages
|