I have a stored procedure and I want to run it once at the same time.
In the other hand Like lock variable in C# programing.
Can anyone help me?
for this situation you can use 2 solution for your critical section and the block you want to only one time a time
First use SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
For example
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
begin Tran
your Query
Commit Tran
Second Use DeadLock priority normal
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
begin Tran
your Query
Commit Tran