Ronnyle
Ronnyle

Reputation: 147

Optimization of bulkinsert insert size

We have a server which receives requests with data that translates to an arbitrary number of rows in my DB (1-1000). Currently, each request data is separately BULKINSERTed to the DB.

The problem is that the request rate is relatively high, which loads the DB. One easement is that we can have the data inserted offline (and not immediately when it arrives). This enables BULKINSERTing several requests in a single call.

As this hardly sounds like a unique situation, we're looking for existing solution (preferably C#/MSSQL).

Thanks

Upvotes: 1

Views: 167

Answers (1)

Wim
Wim

Reputation: 1985

The current system I am working on receives hundreds of messages every second. We validate and translate these messages into POCO objects and add them to different typed Lists. Every 10 seconds we switch Lists and bulkcopy the old lists to the database using SqlBulkCopy. I have made a blog post about this Using SqlBulkCopy with List T

Upvotes: 1

Related Questions