SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Change Ownership of a Maintenance Plan

By Phill Carter,

I experienced problems where I had created maintenance plans under one ID but then wanted to run the scheduled jobs that were created under a different ID, when I updated the owner of the jobs under SQL Agent all ran OK. When ever I changed anything in the maintenance plan it republished the jobs under the ID of the original creator. The choice was update the owner of all the jobs every time I made changes or update the owner of the maintenance plans so that the jobs would end up with the correct owner for running. I had seen various suggestions about deleting the jobs and recreating them but I had already spent a lot of time creating them. Another script for SQL 2005 showed how to change ownership but that didn't work on SQL 2008. With a bit looking a simple modification enabled this script to work against SQL 2008.

Run the script to change the owner of a maintenance plan in SQL 2008. The SID in the example (0x01) corresponds to the SA account, you can use the SID of any account you wish to change ownership to. Be sure to update the WHERE clause with the actual name of the maintenance plan you wish to alter.


Total article views: 2969 | Views in the last 30 days: 2
Related Articles

Change the Maintenance Plan Owner

This article shows how you can change the maintenance plan owner in SQL SERVER


SQL 2005 maintenance plan owner change

how can i change maintenance plan owner in SQL2005


Automatically change the Owner on SQL Agent job

Why does the Owner change when you save the maintenance plan?


How to change the owner

How to change the owner of server


How to change object owner......

Change Object Owner