• curious_sqldba (7/26/2016)


    if i have a sproc that does bunch of reads from one database and writes it to another database, would the read-only type queries automatically get transferred to secondary instance?

    No. The listener doesn't know what you intend to do. If you want to connect to the read only secondary, the connection string has to specify the application intent read only option in the connection string, and if you're writing to another database, then that DB has to be on the secondary server and be read-write, or you'll get errors (if it works at all).

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass