--找出 維護計畫的ID
use msdb;
DECLARE @ID VarChar(max)
SET @ID=(select id from sysmaintplan_plans WHERE name='MaintenancePlan');
--刪除維護計畫相關Table
delete from sysmaintplan_log where plan_id = @ID
delete from sysmaintplan_subplans where plan_id = @ID
delete from sysmaintplan_plans where id = @ID
沒有留言:
張貼留言