master.dbo.xp_sqlmaint N'-PlanID

  • How can I find the PlanID for a Maintenance plan that I created?

    I am trying to setup a job under the Agent, but cant find the PlanID and exactly how to execute the plan successfully.

    I am guessing after finding the ID I can just enter an EXECUTE.... as a T-SQL statement.

    Is this how it is done in all of SQL2000?

  • Maybe a more clear explanation of what I am trying to do...

    I created a Maintenance Plan and need to set it up through the SQL Server Agent. While trying to create the job I go into the steps screen, I choose to run it as a T-SQL Script. But I can't figure out how to put the Maintenance Plan into the step.

    By looking at other jobs that were setup I can see someone used a

    EXECUTE master.dbo.xp_sqlmaint N'-PlanID.....

    But I am not seeing how to implement my plan in the same way.

  • Since this was posted in 2008, by now you may have worked it out. But I thought, I will give in my 5 cents just in case 🙂

    SELECT * FROM msdb.dbo.sysdbmaintplans

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

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