Lesson Learned #156: Creating a Linked Server connecting to Read-Scale Managed Instance Replica

This post has been republished via RSS; it originally appeared at: Azure Database Support Blog articles.

Today, a customer asked how to run a query against the read-scale replica using SQL Server Agent in a Azure SQL Managed Instance.

 

In the following example, I would like to share with you how to achieve this. 

 

In order to instruct how to use the read-scale feature I added the following parameter values for:

 

  • Data Source will be the name of the Managed Instance.
  • Provider String we added the value ApplicationIntent=Readonly
  • Catalog may be master or any database.

Finally, using, for example, the option OPENQUERY or running the query I was able to run my queries to the read-scale replica. 

 

 

SELECT * FROM MyExample.UserDatabaseName.SchemaName.Table WHERE Id=1

 

 

Enjoy!

 

 

REMEMBER: these articles are REPUBLISHED. Your best bet to get a reply is to follow the link at the top of the post to the ORIGINAL post! BUT you're more than welcome to start discussions here:

This site uses Akismet to reduce spam. Learn how your comment data is processed.