I am running in to an issue that I can't figure out how to trouble shoot. It is very weird. I have a fairly complex stored procedure. When I execute the SP from Server Management Studio, it works perfectly. When I pass values that should return no records, I receive a result in less than a second. However, if I call that same stored proc from code in my web application, it times out. I've tried executing the code from classic .asp and from an asp.net 2.0 application. Both time out. If I bump up the execution time for these web apps, after about 2 minutes, I get the desired results.
I am sending the exact same parameters to the exact same SP from the apps as with Management Studio. Very weird. Anyone know how to start troubleshooting something like this? I am at a loss. I've copied and pasted the exact syntax of the SP into a text string and executed that from my web pages, and they work perfectly.