 

DECLARE @PanelInformationValidationSchemaDefaultValues TABLE (
	ParameterType [nvarchar](100) NULL,
	DefaultValue [nvarchar](max) NOT NULL
)


INSERT @PanelInformationValidationSchemaDefaultValues values (N'ControlPanel_MGLS_DefaultTamperUnivesalTransmitter_DefaultValues', N'[{"type": "All","valueType": "string","value": "BedSensor"}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_BypassExtremeTemperature_DefaultValues', N'[{"type": "Dependent","dependent": "SafetyAndSOS_HardwareType","value": false,"dependentOn": ["Sk2","IUNGO","RFDHost","Vpd","Spb","Mgls"],"interdependencies": [{"forValue": "Mgls","dependent": "SafetyAndSOS_InputType","isExists": true,"dependentOn": ["WaterDetector","GasDetector","FireDetector","PanicDetector"]}]},{"type": "Dependent","dependent": "SafetyAndSOS_HardwareType","value": true,"dependentOn": ["Mgls","EpPlus","Epa"],"interdependencies": [{"forValue": "Mgls","dependent": "SafetyAndSOS_InputType","isExists": true,"dependentOn": ["EpilepsyDetector","EnuresisDetector"]}]}]')


MERGE INTO [dbo].PanelInformationValidationSchemaDefaultValues AS TARGET  
USING @PanelInformationValidationSchemaDefaultValues AS SOURCE  
ON TARGET.ParameterType = SOURCE.ParameterType
WHEN NOT MATCHED BY TARGET THEN
INSERT (ParameterType,DefaultValue)
VALUES (SOURCE.ParameterType,SOURCE.DefaultValue )
WHEN MATCHED THEN    
UPDATE SET	TARGET.DefaultValue = source.DefaultValue

OUTPUT $action, SOURCE.*;

