We have a program that connects to our database and runs some stored procedures to get some data.
The database is SQL Server 2008, and the program runs locally. The connection is through TCP / IP, but shared memory is enabled. And the connection string timeout is set to 45 seconds.
When we run them through SQL Server Management Studio, it takes 0-5 seconds to execute. When we run it through the code, it is randomly disabled.
To do some testing, we increased the timeout from 45 seconds to several minutes. In addition, to discard any locking problem, we verified that the stored procedures only βselectβ the data (without the insert or update instructions). And we tried several table modifiers for select statements, such as: nolock , readpast , ...
I also checked sp_who2 and dbcc opentran() , and nothing is blocked ... and SPID.Net is a running command ... For more information, while .Net is waiting for a DB response, through SQL Server Management Studio I can work with the same operator (stored procedure or Select) without any problems.
Any suggestion on what's going on?
source share