Hello there.
I am trying to figure out how to run jobs in a SQL Server Always On setup.
Basically, I need to add a piece of logic in my jobs that will test if the database (or replica) is the primary. If so, the job will continue, otherwise will silently stop.
Does anybody have a ready to go query that does it?
Thank you!