Hi Forum,
I have a problem with checking the availability of linked Servers before code execution.
I created a procedure using sp_testlinkedserver which works fine. I use an OUT parameter to return the result of this check and then try to use it in an if-statement.
When the linked Server is not available the logic of my code would skip the affected server. Only I don't get there, because it seems that SQL Server (2012 Standard) checks the availability before my code - no matter what.
There is an option for the linked server called 'Lazy Schema validation' which I believe is the reason for the behavior. Unfortunately it cannot be changed in Standard Edition.
If my assumption is correct, how can I define my code in order to still run when the linked server is offline in Standard Edition? At some point in my code I have to address the server and doing that seems to be the problem.
Please don't tell me that this will only work in Standard Edition if I put all my statements in text and use sp_sqlexec instead.
TIA
Alex