Page 1 of 1

Performance of Inserts

Posted: Wed 22 Jun 2016 18:25
by davidaustin
When inserting data into our tables LinqConnect creates code which follows the following pattern

INSERT INTO dbo.table (colNames)
VALUES (@p1);
SELECT rowid FROM dbo.table WHERE rowid = SCOPE_IDENTITY();

We are concerned about the performance of the Select statement. Is there are reason it is not just doing a "Select SCOPE_IDENTITY();" ?

Our database is becoming a bottle neck in our application and we need all the performance we can out of it.

Re: Performance of Inserts

Posted: Tue 28 Jun 2016 10:53
by Shalex
Thank you for your suggestion. We will optimize the SQL generation when only one property is Auto-Sync=OnInsert and notify you about the result.

The current SQL template is used to unify the generation. For example, if there would be two or more Auto-Sync=OnInsert properties, the SQL would be the following:
SELECT rowid, Property2, Property3, ... FROM dbo.table WHERE rowid = SCOPE_IDENTITY();