Bulk insert to sql server

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi.
We have an object model that return a list of about 2500 lins and i want to
add them to sql as fast as i.

How can I do a bulk insert to sql Using ADO.net?

Thanks
 
Hi Ran,

In ADO.NET 2.0, class SqlBulkCopy can be used to bulk copy
dataset to db. But in ADO.NET 1.1, you should implement
bulk insert yourself.

In my experience, I used StringBuilder to build a large
string and write to a text file, then perform bulk insert
the file content to db. It's much much faster then insert
row by row loop thru datatable.

HTH

Elton Wang
(e-mail address removed)
 
Back
Top