What is the maximum number of concurrent INSERT queries for Microsoft SQL Server?


If multiple different services send INSERT queries for the same table simultaneously to SQL Server, using their own connections, how many INSERTS can be committed by SQL Server in parallel? Or SQL Server can only process them sequentially?

>Solution :

You can have up to 32,767 user connections. The INSERT behavior depends on factors like the Types of concurrency.

How fast is the insert operation depends on the table columns (count, type), its indexes, its foreign keys. The engine may need to check a lot of things in order to leave the database in a consistent state.

Let’s say you are performing only INSERT operations and not other ones on this table with one column and primary key:

CREATE TABLE [dbo].[DemoUsers]

INSERT INTO [dbo].[DemoUsers] ([UserID])
VALUES (101)

Then in two separate query windows execute the following statements:


    INSERT INTO [dbo].[DemoUsers] ([UserID])
    VALUES (107);



INSERT INTO [dbo].[DemoUsers] ([UserID])
VALUES (108);


It’s like two user are trying to insert a row which is taking some time (because the transaction is not committed):

You can see that IX lock on the same PAGE of the first transaction is not blocking the IX on the page of the other one:

In theory the inserts are not blocking each other and can be executed at the same time.

Leave a Reply Cancel reply