Bulk Call Stored Procedure

We have an ETL process which handles roughly 2.3 million items an hour and for each item that is processed, we call a stored procedure to load it into the database.

Our ideal solution would be to split these into batches of 3-5k and call the stored procedure for the batch rather than one-by-one.

Is this possible with OrmLite?

There’s no explicit support for batching in the typed API’s. But sending multiple requests will be more efficient using the Async API’s.

Otherwise I expect you should be able to use the Custom SQL API’s to concatenate a batch of calls in a single SQL Statement, but using db Params could get unwieldy quickly, so I’d probably pass the arguments as literals.

Is there any support for invoking SqlBulkCopy within OrmLite?

No, SqlBulkCopy is SQL Server specific and requires working with the concrete class directly.

If you need the underlying Sql Server SqlConnection you can get it with:

var sqlConn = (SqlConnection) db.ToDbConnection();

Perfect. Thank you very much.