Database engine independent analog of SqlBulkCopy

database-independent sql sqlbulkcopy sql-server

Question

What is the best database engine independent way to load a huge amount of data.

While I'm using SQL Server I use SqlBulkCopy but want to untie from SQL Server

Accepted Answer

There is no database engine independent way of doing this. Each DB server has its own way (e.g. bcp for Sybase).

There may be some 3rd party product which can do the work for you but it will merely be a wrapper around server-specific methods underneath (If that's what you're looking for, you may want to clarify your question).

NOTE: doing a bunch of INSERTs as Mark suggested is definitely not the same, since INSERTs are MUCH slower than native bulk inserts due to being logged (unlike bcp).


Popular Answer

Database independent bulk insert? Not possible.

The closest I can think of is to create an insert script with lines like this:

INSERT INTO TableName (...) VALUES (...);

It will compress well, so you might want to gzip it.

You're probably better off sticking with the database specific commands though. "Database independent" is often just a synonym for "slow".




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why