From 13d3ccfbfd9463e0658028cd29de5967366aba87 Mon Sep 17 00:00:00 2001 From: Randolph West Date: Sat, 12 Sep 2020 21:48:09 -0600 Subject: [PATCH] Drop stored proc if exists Add DROP PROCEDURE for automated installs of this procedure. --- BPCheck/Check_BP_Servers.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BPCheck/Check_BP_Servers.sql b/BPCheck/Check_BP_Servers.sql index fe8b9fb8..7f343e19 100644 --- a/BPCheck/Check_BP_Servers.sql +++ b/BPCheck/Check_BP_Servers.sql @@ -1,9 +1,12 @@ USE [msdb] GO -/* -Replace CREATE PROCEDURE with ALTER PROCEDURE or CREATE OR ALTER PROCEDURE to allow new changes to the SP if the SP is already present. +-- Drop the SP if the SP is already present. +IF OBJECT_ID('dbo.usp_bpcheck') IS NOT NULL + DROP PROCEDURE dbo.usp_bpcheck +GO +/* Usage examples: EXEC usp_bpcheck EXEC usp_bpcheck @allow_xpcmdshell = 0, @ptochecks = 1, @duration = 60