Page 1 of 1

Can't batch insert with identity PK

Posted: Wed 22 Mar 2017 20:29
by aerotog
Using LinqConnect 4.5.1090 with MS SQL Server.

Recently we've been looking at database performance improvement and realized that several of our INSERT statements were taking much longer than others. After looking more closely at the SQL statements, it appears that any table with an IDENTITY column or a TIMESTAMP column is not using batch updates.

I've looked through the forums and seen a few posts related to this without a solid answer/solution to the following question:

Is it possible to batch INSERT to a table that has an auto-generated column (i.e. IDENTITY or TIMESTAMP)?

Re: Can't batch insert with identity PK

Posted: Thu 23 Mar 2017 18:26
by Shalex
aerotog wrote:Is it possible to batch INSERT to a table that has an auto-generated column (i.e. IDENTITY or TIMESTAMP)?
You can do that, but you should set Auto-Sync=Never for your AutoGeneratedValu=True and IsVersion=True properties to avoid generation of the RETURNING clause which is not supported by Batch Updates: https://www.devart.com/linqconnect/docs ... dates.html.