SqlBulkCopy's database engine independent counterpart

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

1
0
2/13/2010 9:54:59 PM

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).

2
2/13/2010 10:13:17 PM

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".



Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow