Click here to Skip to main content
15,886,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello all, this is my first post ever since I joined this community. Sorry for my poor English.

Imgur: The most awesome images on the Internet[^]

refer to the above image link:
SPID 51 was doing insert statement
SPID 60 was doing update statement

I have no ideas how come SPID 60 can out of sudden execute the insert statement which suppose to be execute by SPID 51

What I notice from the trace is that each SPID will have Audit Login, RPC Completed, Audit Logout. But SPID 51 just missing the Audit Logout.

If I run the sp_who2, it will show SPID 60 is blocked by SPID 51
If I run report from SSMS, it shows SPID 51 isolation "Unknown"

I wonder how can this happen? Could network issue causing this? Please help me, thank you.

What I have tried:

Since I have no idea how this happen so I have not try any way to solve it
Posted
Updated 8-Apr-16 1:13am
Comments
RickZeeland 8-Apr-16 6:27am    
I guess it's normal, when I use SQL Server 2008R2 with ExpressProfiler it shows different SPID's too for the same .NET application. Other databases use multiple threads too.
I can not think of a way to prevent this, sorry !

1 solution

Maybe you can set the "Max Degree of Parallelism" to 1, in general this is not recommended though, but if you must ...
How to: Configure the Number of Processors Available for Parallel Queries (SQL Server Management Studio)[^]

Here is an example of setting the MAXDOP query hint:
SQL
USE AdventureWorks2008R2 ;
GO
SELECT ProductID, OrderQty, SUM(LineTotal) AS Total
FROM Sales.SalesOrderDetail
WHERE UnitPrice < $5.00
GROUP BY ProductID, OrderQty
ORDER BY ProductID, OrderQty
OPTION (MAXDOP 1);
GO
 
Share this answer
 
v2
Comments
nethelp11 15-Apr-16 3:12am    
@rickZeeland I tried your "option (maxdop 1)" but problem still persist.
refer to http://imgur.com/a/tdgm5
I'm using webservices to run the storeprod, really crack my head to think of a way to solve this...

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