How to run Maintenence Plan using script ?

 Posted by PandianS on 10/23/2010 | Category: Sql Server Interview questions | Views: 3225 | Points: 40
Answer:

DECLARE @PlanID  VARCHAR(36)


SELECT @PlanID = id FROM msdb.dbo.sysmaintplan_plans
WHERE [NAME] ='Maintenance Plan Name'

EXECUTE msdb..sp_maintplan_start @PlanID,NULL
GO


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response