	--UserSettingsTypes
	DECLARE @UserSettingsTypes TABLE (RowId uniqueidentifier NOT NULL,[Name] [nvarchar](500) NOT NULL,SettingsType int NOT NULL);

	INSERT into @UserSettingsTypes (RowId, [Name], SettingsType) VALUES ('54640A2C-C9E9-46CD-BFE9-BEE5EFF7F0DD', N'AiChatHistoryDays',3);

	INSERT into @UserSettingsTypes (RowId, [Name], SettingsType) VALUES ('2C071EC3-EDDE-4120-B8EA-2AEA3E8EE95F', N'AiChatHistoryPrompts',3);
	

	MERGE INTO dbo.[UserSettingsTypes] AS TARGET  
		USING @UserSettingsTypes AS SOURCE  
		ON TARGET.RowId = SOURCE.RowId	
		WHEN MATCHED THEN    
			UPDATE SET	[Name] = SOURCE.[Name],
						[SettingsType] = SOURCE.[SettingsType]
		WHEN NOT MATCHED BY TARGET THEN   
			INSERT (RowId, [Name], SettingsType) VALUES (SOURCE.RowId, SOURCE.[Name], SOURCE.SettingsType)  
	OUTPUT $action, SOURCE.*;