Search code examples
sqlbltoolkitbatch-insert

What means 'maxBatchSize' parameter in InsertBatch method


BLToolkit has InsertBatch method to insert a set of objects.

What is the meaning of 'maxBatchSize' parameter? I was not able to find any documentation on that, neither that clear from source code.

Please advise.

Thanks.

P.S. I believe that is parameter which tells what amount of records/objects should be inserted per query, but why does it have 'max' prefix?


Solution

  • maxBatchSize is the maximum number of objects allowed to be inserted in one SQL insert command. The real number of objects inserted per SQL command may be less if :

    • you pass lower number of objects,
    • or maximum number of parameters per SQL command is hit, as object members are translated to parameters