Scripts

Technical Article

Automatically Failover (Enable or Disable) Jobs Based on HADR Role

If you have a SQL Server with a High Availability solution (AlwaysOn Availability Groups, Database Mirroring, etc.), and you also have a bunch of jobs which you need to be run on the Primary server only. You need to be able to "failover" the jobs in case the Primary server is no longer Primary.

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(1)

You rated this post out of 5. Change rating

2018-11-14 (first published: )

6,197 reads

Blogs

The #MS_DatabaseConnector## Role: #SQLNewBlogger

By

I had seen these roles in various instances, but never dug into the new...

Asking for Help Isn’t a Weakness

By

During COVID, I attended training on software/enterprise architecture given by Mark Richards. One of...

The Proof of the Backup Is in the Pudding

By

For me, the objective is straightforward: have a backup strategy that is reliable, understandable,...

Read the latest Blogs

Forums

Pay for Performance

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Pay for Performance, which is...

Alamat BCA KCP Surya Kencana Hub/Wa. 0817-819-444

By layanan 24jam BCA

WhatsApp:0817819444 Jl. Suryakencana No.260 C & D, RT.01/RW.05, Babakan Ps., Kecamatan Bogor Tengah, Kota...

Alamat BCA KCP Ketapang Hub/Wa. 0817-819-444

By Halo_BCA

WhatsApp:0817819444 Blok A/3-4, Ketapang Indah, Jl. KH Zainal Arifin, RT.5/RW.7, Krukut, Kec. Taman Sari,...

Visit the forum

Question of the Day

The ##MS_DatabaseConnector## User

On SQL Server 2025, I run this code as a sysadmin:

CREATE LOGIN Demo WITH PASSWORD = 'Demo1234567'
GO
ALTER SERVER ROLE ##MS_DatabaseConnector## ADD MEMBER Demo
GO
I then login as Demo and run this:
USE sandbox
go
SELECT CURRENT_USER
What is returned?

See possible answers