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