We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Problem with that is - if either SQLPROD2 or SQLDR2 is offline - the SP fails, because referential integrity is validated at "prepare", and an inaccessible server throws an error, even though it would not be actually referenced at all at execution.
IF @@SERVERNAME = 'SQLPROD1' EXEC SQLPROD2.MyDB.dbo.mySP ELSE EXEC SQLDR2.MyDB.dbo.mySP
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.