I think I explained myself incorrectly. I want to do this in a SQL Query.
I have a 3rd party application that allows me to run SQL against the database that pulls back results for anlaytical purposes. I have created SPs within the database and simply use the EXEC command from the query windows within this application.
Unfortunately, the application does not allow me to change the Application Intent = Read Only. So the quetion remains, am I able to achieve this in T-SQL?
Thanks for you reply.
You cannot do this with TSQL. Like I said, once you are connected to SQL Server you are on that box, and it doesn't use/know about a .NET connection string to hop over to another server. Maybe someone else has a trick I am unaware of...
I haven' tried it, but I suppose you can try a linked server over to the secondary. I have no confidence that it will be allowed or functional, but you never know.
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru at GMail