January 11, 2018 at 12:21 pm
Hi,
I have a SQL Server 2016 Availability Group between two geographic sites. In a couple of our stored procedures, we are using linked servers that have to be updated manually if the AG fails over to the other site.
I was wondering if there was an easy way to modify the stored procedures to automatically executes the correct linked server.
Any help is GREATLY appreciated!
Thank you!
January 11, 2018 at 12:35 pm
Perhaps something like:
Declare @SQL as varchar(max)
Set @SQL = 'Select
''hello world''
as Message
'
--pseudo code for checking if site 1 or site 2 is down
IF Site 1 is down
Then exec (@SQL) at [LinkedServerForSite2]
else Then exec (@SQL) at [LinkedServerForSite1]
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy