SELECT query in a SP in AlwaysOn Availability Group Read Only Routing There is a stored procedure which has select statement as well as insert and other statements. What will be the behaviour of the stored procedure in a Read Only Routing configured in AlwaysOn Availability Group?
Will the select statement go to the secondary server for reading and rest will be done on the primary server or since it is an inline statement in a stored procedure, that's why everything will take place on the primary itself.
I could not find any documentation regarding this, how will the select statement behave?
Read-only routing is per connection, not per batch or statement. Read-only intent is specified via the application connection string and the connection will be directed to a read-only replica (if possible) when the connection is established.