Stored proc executes >30 secs when called from website, but <1 sec when called from ssms

Posted by Blootac on Stack Overflow See other posts from Stack Overflow or by Blootac
Published on 2010-05-11T08:14:17Z Indexed on 2010/05/11 8:34 UTC
Read the original article Hit count: 180

Filed under:
|
|

I have a stored procedure that is called by a website to display data. Today the web page has started timing out so I got profiler going and saw the query that was taking too long. I then ran the same query in management studio, under the same user login, and it takes less than a second to return.

Is there anything obvious that could be causing this? I can't think of a reason why when ASP calls the stored proc it takes 30 secs but when I call it it's fine.

Thanks

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about sql-server-2005