SQLAgent job owner change TSQL

TSQL to change SQLAgent job owner

Today I discovered many SQLAgent jobs had non-sa ownership of the job. It was replication jobs created by me.

Here is a TSQL script to change job ownership from whatever user to ‘sa’. Or to whatever user you want.

Just change two parameters: @NewOwner and @OldOwner.

Leave a Comment