High Availability - only run on primary

  • Hi,

    We have H/A setup on SQL2012. Seems to work fine.

    I thought there was code I could add that would check to see if it was running on the primary node?

  • see if what is running on the primary node?

    code running from where?

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • krypto69 (3/9/2015)


    Hi,

    We have H/A setup on SQL2012. Seems to work fine.

    I thought there was code I could add that would check to see if it was running on the primary node?

    The "PRIMARY" node is simply the one that is currently hosting the active read-write replica(s) for a given AG. I would imagine you want to know if it is on a particular server that you consider the "main" one. Review Books Online for DMVs related to Always On and you will find one(s) that will allow you to determine who is hosting what, what the states are, etc.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply