--01 - parameter types
	DECLARE @ConfigurationParameterTypes TABLE (Id int NOT NULL,Title nvarchar(max) NOT NULL);

	INSERT into @ConfigurationParameterTypes (Id, Title) VALUES (87, N'FailedLoginDelayWindow')
	INSERT into @ConfigurationParameterTypes (Id, Title) VALUES (88, N'FailedLoginDelayMaxAttempts')
	INSERT into @ConfigurationParameterTypes (Id, Title) VALUES (89, N'FailedLoginDelayTimeInSeconds')
	INSERT into @ConfigurationParameterTypes (Id, Title) VALUES (90, N'FailedLoginDelayEnable')

	SET IDENTITY_INSERT dbo.ConfigurationParameterTypes ON

MERGE INTO dbo.ConfigurationParameterTypes AS TARGET  
	USING @ConfigurationParameterTypes AS SOURCE  
		ON TARGET.Id = SOURCE.Id
		WHEN MATCHED THEN    
			UPDATE SET Title = SOURCE.Title
		WHEN NOT MATCHED BY TARGET THEN   
			INSERT (Id, Title) VALUES (SOURCE.Id, SOURCE.Title)  
	OUTPUT $action, SOURCE.*;

	SET IDENTITY_INSERT dbo.ConfigurationParameterTypes OFF



---02 - add the parameters to ConfigurationGroupParameters table

DECLARE @meshGroupParameters TABLE (groupid int, parameterid int, value nvarchar(50));

insert into @meshGroupParameters selecT GroupId,87,'5' FROM ConfigurationEntityTree where ModuleIdentifier='PasswordPolicy'		  --FailedLoginDelayWindow
insert into @meshGroupParameters selecT GroupId,88,'3' FROM ConfigurationEntityTree where ModuleIdentifier='PasswordPolicy'		  --FailedLoginDelayMaxAttempts
insert into @meshGroupParameters selecT GroupId,89,'30' FROM ConfigurationEntityTree where ModuleIdentifier='PasswordPolicy'	  --FailedLoginDelayTimeInSeconds
insert into @meshGroupParameters selecT GroupId,90,'False' FROM ConfigurationEntityTree where ModuleIdentifier='PasswordPolicy'	  --FailedLoginDelayEnable

MERGE INTO dbo.ConfigurationGroupParameters AS TARGET  
	USING @meshGroupParameters AS SOURCE  
		ON TARGET.Groupid = SOURCE.groupid and target.parameterid=source.parameterid
		WHEN NOT MATCHED BY TARGET THEN   
			INSERT (groupid, parameterid,value) VALUES (SOURCE.groupid, SOURCE.parameterid, source.value)  
	OUTPUT $action, SOURCE.*;
