I have a very weird scenario occur at work today in our production system. Wondering if anyone has seen anything like this and have a good explanation for me.
We have a stored procedure in Sql Server 2014 and it was not returning any data when our .NET system called it.
We captured the call using Sql Profiler and replayed it in Sql Management Studio using the same Sql Authentication credentials and it returned results as expected.
No matter how many times we tried each interchangeably, they were consistent in that when the client was the .NET Client, it gave no results and when it was SSMS it worked fine. Keep in mind, its the exact same sp, params, etc.
We were able to resolve the issue by doing an SP Recompile but that feels like a temporary solution and not know the original cause means that it can recur without warning. Furthermore, I was under the impression that sp recompile only affects performance issues not differing results.
Has anyone seen this before? Can you explain why an sp recompile fixed it?
Many Thanks!