Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
how do i make parallel sql execution with different connections


I create a process with SQL Stored Procedure, Multiple users will run the process simultaneously. But it gets stuck when 2 or more user do the process together.

Any help how parallel execution work with different-2 connections.

What I have tried:

I create a process with SQL Stored Procedure, Multiple users will run the process simultaneously. But it gets stuck when 2 or more user do the process together.
Posted
Updated 6-Jan-17 6:29am
Comments
Maciej Los 29-Dec-16 1:37am    
What kind of operation the stored procedure is doing?

1 solution

I think the problem won't be caused by simultaneously calls of the stored procedure itself (SQL server will process them in different user sessions) but what the procedure does may lead to dead locks when accessing/modifying the same table data at the same time. You'll have to ensure, that the procedure doesn't do the same actions at the same time for 2 different users. May be you can use a small table to flag the operations in progress so that any running instance of that procedure is able to synchonize it's actions.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900