Dev has made available a new store proc that works when suppression key is of format 'monitoringtype/ProfileName'
---------SSRV2GetProfileName_New.sql -----------
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'SSRV2GetProfileName_New') AND type in (N'P', N'PC')) DROP PROCEDURE SSRV2GetProfileName_New;
GO
create procedure [dbo].[SSRV2GetProfileName_New] @supp_key NVARCHAR(MAX),
@defaultCpuProfile NVARCHAR(MAX) = 'CPU Monitor',
@defaultMemoryProfile NVARCHAR(MAX) = 'Memory Monitor',
@defaultDiskProfile NVARCHAR(MAX) = 'Default Disk(s)'
AS
DECLARE @MonType AS NVARCHAR(MAX),
@RemainingLine AS NVARCHAR(MAX),
@ProfileName AS NVARCHAR(MAX),
@foundIdx AS bigint
select @MonType = substring(@supp_key,0,charindex('/',@supp_key))
select @RemainingLine = substring(@supp_key,CHARINDEX('/',@supp_key)+1,LEN(@supp_key))
select @foundIdx = CHARINDEX('/',@supp_key)
if @foundIdx > 0
BEGIN
select @ProfileName = @RemainingLine
END
ELSE
BEGIN
if @MonType = 'cpu'
select @ProfileName = @defaultCpuProfile
else
BEGIN
if @MonType = 'memory'
select @ProfileName = @defaultMemoryProfile
else
select @ProfileName = @defaultDiskProfile
END
END
select @ProfileName as profile
GO
---------SSRV2GetProfileName_New.sql ------------