Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Im currently writting an application for mailing and I need to insert 100,000's of records every few days into the SQL Server 2000 database.

 

Is there a very very fast way for me to insert these into the database application?

 

I know about the bcp.exe for importing but is there another way using .NET

 

Cheers

 

Andy

Code today gone tomorrow!
  • *Experts*
Posted

If the records aren't too big, 100,000 could be handled with insert statements. But I'd look into using bcp as that's what it's for.

 

I know of no way to automate bcp from .NET - it's just a command line utility.

 

You could possibly use DTS (Data Transformation Services?). I've used it from within SQL Server Enterprise Manager, but I've never tried to use the packages it creates from a programming language. There might be a COM interface to it - I doubt there is a pure .NET solution, but who knows?

 

DTS is similar to bcp. In fact, if you don't provide any scripting in the transform layer, it acts just about as fast as bcp.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted
You can also use the BULK INSERT command from T-SQL if you don't like shelling out processes. Yes, you could also use DTS and it can be automated via COM but it may be too complex for a relatively simple task.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...