I have SQL call to stored procedure in my ASP.NET application using nHibernate:
GetNamedQuery("MyProc")
.SetString("param1", value1)
.SetString("param2", value2)
...
SQL Server 2005 used here. It runs well on our testing environment, this call takes about 2 seconds to complete. But when we move it to new server it starts to take very long time for this and I got timeout exception in my application.
However, I catch calls in SQL Server Profiler, find that this one runs for 30 sec. But when I copied the same query and just run it on server it completes in 2 sec.
So the question is what can affect working queries from .NET application?