I'm facing a very specific issue on my SQL server instance. Recently I had to create a linked server (referencing server B) in my server A, to connect to a database in B through A. Everything worked and works well when I'm in the server A (accessing via remote desktop).
I need to query the server A through an Apache application, it always worked. But when I need to query the server B through the A using Apache (not in remote desktop, where it works), the query fails to complete, so I open SSMS, execute the same query and it returns the following error:
"Login failed for user 'NT AUTHORITY\ANONYMOUS LOGIN'"
What really concerns me is that it's not an authentication error (even though the message says it), because when I access the server A via RD, execute the query and come back to the Apache application, then I am able to query, which makes no sense at all.
It looks like it's an intermittent issue, and sometimes I just can't force it.