Maintenance plan

  • Hi all,

    I have made a maintance plan and the owner of the maintance plan is my Windows account.

    I would like to change the owner to SA, because i need to script this object (maintenance plan) and send it to other servers where i don't have this windows account.

    How can i accomplish this?

    Thank you

  • I don't think you can script Maintenance plan in SQL 2005, but if you need to change job's owner you can use this stored procedure:

    EXEC msdb.dbo.sp_update_job @job_name = 'job_name', @owner_login_name = 'sa'

  • You have to manually update the table - the table you want is the sysdtspackages90 table in the msdb database. Set the ownersid column to 0x1 (sa) for package types = 6 which are the maintenance plans.

    After updating the package, open it in SSMS - and re-save it. This will update the agent jobs with the new owner. if that doesn't work, make a change in the package - then save it.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

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

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