Re: Most efficient way to insert 1,000,000 records?
- From: "Ignacio Machin \( .NET/ C# MVP \)" <ignacio.machin AT dot.state.fl.us>
- Date: Wed, 4 Jan 2006 14:31:13 -0500
Hi,
"chrisben" <chrisben@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:208C5B43-3F21-4BF8-94CD-E3CCD8B9B79B@xxxxxxxxxxxxxxxx
> Hi,
>
> I need to insert more than 500,000 records at the end of the day in a C#
> application. I need to finish it as soon as possible.
In a C# app or in a DB used by a C# app?
> I created a stored procedure and called it from ADO to insert one by one.
> It
> is kind of slow (seems slower than using a DTS package to import from a
> file).
>
> Just a general question, in ADO, what will be the MOST efficient way to do
> this work. I normally do it as I described. I am using .NET framework 1.1
> and SQL Server 2000.
In short, none, ADO.NET is not intented for this. You have two options, use
bulk copy (bcp.exe ) that comes with SQL server or as Paldino suggested
(that is also my recommended solution) using DTS, DTS can be scripted from
C# so you will have flexibility to change it as needed.
Just create a DTS from enterprise manager, select write package to disk and
later you can load and execute it.
Let me know if you need code, I do this in a couple of deployments.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
.
- Prev by Date: Re: Process.MainModule.Filename is in DOS format
- Next by Date: Re: MVC-Pattern in my C# GUI !?!
- Previous by thread: Re: Most efficient way to insert 1,000,000 records?
- Next by thread: Re: Most efficient way to insert 1,000,000 records?
- Index(es):
Relevant Pages
|