Today, I had an issue with a SPROC Timing Out (took longer than 30 seconds) when it was run from an ASP.NET webpage, but executed quickly when run from SSMS (took 5 seconds).
After suspecting Parameter Sniffing as the culprit, I Masked the Input Parameters, and the query executed faster.
My Question Is:
Why did this happen? This system has been in production for more than 5 years, and this is the first time we've seen anything like this on our SPROCs. Is this "Database wear and tear"?
We've resolved the issue, so it isn't a big deal, but I'm just curious as to why this was happening.