Reputation: 9204
I was getting some timeouts on my app when I was trying to call a specific stored procedure. I isolated it down to a specific sproc and found that when I call a tablevalued function in that sproc with a parameter it takes forever to run. But if I pass in a specific value (like 804) it will return quickly.
If I run it by itself with the parameter it runs fine, but when I add it back into the query with the parameter it runs forever....then swap out the param with a static value and it runs quickly?
Steps I have taken:
DBCC FREEPROCCACHE
on all plans containing a similar query string.Another thing to note. On another db on the same server...about the same amount of data it runs fine......very strange.
What am I overlooking? I really don't get it.
Upvotes: 0
Views: 863
Reputation: 432657
Sorry for the short answer, but worth reading some answers...
From me previously too
Upvotes: 1