﻿-- SP cleanup
DECLARE
   @pSchemaName nvarchar(100) = NULL
  ,@spList nvarchar(max)
  ,@spName nvarchar(100) = 'sp_GetIgazolasInfo'

  SET @spList = (
    SELECT r.ROUTINE_NAME AS "StoredProcedureName" 
    FROM INFORMATION_SCHEMA.ROUTINES r
    WHERE r.ROUTINE_SCHEMA = 'dbo' AND r.ROUTINE_TYPE = 'PROCEDURE'
      AND r.ROUTINE_NAME = @spName
    FOR XML PATH(''), ROOT('StoredProcedureNames')
  )
  --select @spList
  IF @spList IS NOT NULL BEGIN
    EXEC sp_Global_DeleteStoredProcedures @pSchemaName, @spList
  END
GO
