
	--02. Add rows to [dbo].[Log_Events_Filter]
	DECLARE @Log_Events_Filter TABLE ([EventId] INT NOT NULL);

	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (7)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (16)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (18)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (20) -- StopSirenByUserRequest
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (21)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (35)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (36)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (37)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (38)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (41)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (42)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (205)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (206)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (218)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (219)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (301)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (313)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (334)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (335)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (406)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (410)
	-- 512 not is use and can be replaced by new one.
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (512)	
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (702)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (705)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (706)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (801)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (802)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (860)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (861)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (862)	
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (902)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (905)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (908)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (911)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (914)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (917)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (920)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (1000)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (1001)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (1002)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (1500)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (1868)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (1869)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (1870)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (1873)
	INSERT INTO @Log_Events_Filter ([EventId]) VALUES (10000)

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

	DELETE FROM dbo.[Log_Events_Filter] WHERE [EventId] = 1200
	
	
	--03. Add rows to [dbo].[CD_NotificationProfiles]
	DECLARE @CD_NotificationProfiles TABLE ([ProfileId] TINYINT NOT NULL, [ProfileName] text NOT NULL, [ProfileDescription] text NOT NULL);

	INSERT INTO @CD_NotificationProfiles (ProfileId, ProfileName,ProfileDescription) VALUES ('0', 'None', '')
	INSERT INTO @CD_NotificationProfiles (ProfileId, ProfileName,ProfileDescription) VALUES ('1', 'Standard', 'Alarm/reset Alarm & severe malfunction events')
	INSERT INTO @CD_NotificationProfiles (ProfileId, ProfileName,ProfileDescription) VALUES ('2', 'Standard', 'Alarm/reset Alarm & severe malfunction events')
	INSERT INTO @CD_NotificationProfiles (ProfileId, ProfileName,ProfileDescription) VALUES ('3', 'Comfort', 'Basic & Home Automation & comfort video event')
	INSERT INTO @CD_NotificationProfiles (ProfileId, ProfileName,ProfileDescription) VALUES ('4', 'Comfort', 'Basic & Home Automation & comfort video event')
	INSERT INTO @CD_NotificationProfiles (ProfileId, ProfileName,ProfileDescription) VALUES ('5', 'Advanced', 'Basic & technical problems events')
	INSERT INTO @CD_NotificationProfiles (ProfileId, ProfileName,ProfileDescription) VALUES ('6', 'Advanced', 'Basic & technical problems events')
	INSERT INTO @CD_NotificationProfiles (ProfileId, ProfileName,ProfileDescription) VALUES ('7', 'Attendence', 'Basic & Attendance')
	INSERT INTO @CD_NotificationProfiles (ProfileId, ProfileName,ProfileDescription) VALUES ('8', 'Attendence', 'Basic & Attendance')

	MERGE INTO dbo.[CD_NotificationProfiles] AS TARGET  
	USING @CD_NotificationProfiles AS SOURCE  
	ON TARGET.[ProfileId] = SOURCE.[ProfileId]  
	WHEN MATCHED THEN    
	UPDATE SET [ProfileName] = SOURCE.[ProfileName], [ProfileDescription] = SOURCE.[ProfileDescription]
	WHEN NOT MATCHED BY TARGET THEN   
	INSERT ([ProfileId], [ProfileName], [ProfileDescription])   
	VALUES (SOURCE.[ProfileId], SOURCE.[ProfileName], SOURCE.[ProfileDescription])  
	OUTPUT $action, SOURCE.*;
	
	
	--04. Add rows to [dbo].[CD_PanelArmStatus]
	DECLARE @CD_PanelArmStatus TABLE ([Id] INT NOT NULL, [Panel_Status] nchar(15) NULL);

	INSERT INTO @CD_PanelArmStatus ([Id], [Panel_Status]) VALUES (0, N'Disarm         ')
	INSERT INTO @CD_PanelArmStatus ([Id], [Panel_Status]) VALUES (1, N'Armed          ')
	INSERT INTO @CD_PanelArmStatus ([Id], [Panel_Status]) VALUES (2, N'Forced Arm     ')
	INSERT INTO @CD_PanelArmStatus ([Id], [Panel_Status]) VALUES (3, N'Delay Armed    ')

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

	--05. Add rows to [dbo].[CD_PD_PartitionTypes]
	DECLARE @CD_PD_PartitionTypes TABLE ([PartitionCode] SMALLINT NOT NULL, [Description] NVARCHAR(20) NOT NULL);

	INSERT INTO @CD_PD_PartitionTypes ([PartitionCode], [Description]) VALUES (1, N'Partition1')
	INSERT INTO @CD_PD_PartitionTypes ([PartitionCode], [Description]) VALUES (2, N'Partition2')
	INSERT INTO @CD_PD_PartitionTypes ([PartitionCode], [Description]) VALUES (3, N'Partition3')
	INSERT INTO @CD_PD_PartitionTypes ([PartitionCode], [Description]) VALUES (4, N'Perimeter')

	MERGE INTO dbo.[CD_PD_PartitionTypes] AS TARGET  
	USING @CD_PD_PartitionTypes AS SOURCE  
	ON TARGET.[PartitionCode] = SOURCE.[PartitionCode]  
	WHEN MATCHED THEN    
	UPDATE SET [Description] = SOURCE.[Description]
	WHEN NOT MATCHED BY TARGET THEN   
	INSERT ([PartitionCode], [Description])   
	VALUES (SOURCE.[PartitionCode], SOURCE.[Description])  
	OUTPUT $action, SOURCE.*;
	
	
	--06. Add rows to [dbo].[CD_PhoneTypes]
	DECLARE @CD_PhoneTypes TABLE ([Id] INT NOT NULL, [Type] NVARCHAR(200) NOT NULL);

	INSERT INTO @CD_PhoneTypes ([Id], [Type]) VALUES (0, N'None')
	INSERT INTO @CD_PhoneTypes ([Id], [Type]) VALUES (1, N'Blackberry')
	INSERT INTO @CD_PhoneTypes ([Id], [Type]) VALUES (2, N'iPhone')
	INSERT INTO @CD_PhoneTypes ([Id], [Type]) VALUES (3, N'Symbian')
	INSERT INTO @CD_PhoneTypes ([Id], [Type]) VALUES (4, N'Android')
    INSERT INTO @CD_PhoneTypes ([Id], [Type]) VALUES (5, N'AndroidGcm')

	MERGE INTO dbo.[CD_PhoneTypes] AS TARGET  
	USING @CD_PhoneTypes AS SOURCE  
	ON TARGET.[Id] = SOURCE.[Id]  
	WHEN MATCHED THEN    
	UPDATE SET [Type] = SOURCE.[Type]
	WHEN NOT MATCHED BY TARGET THEN   
	INSERT ([Id], [Type])   
	VALUES (SOURCE.[Id], SOURCE.[Type])  
	OUTPUT $action, SOURCE.*;
	
	--07. Add rows to [dbo].[CD_Plan]
	SET IDENTITY_INSERT dbo.[CD_Plan] ON
	DECLARE @CD_Plan TABLE ([Id] INT NOT NULL, [Name] NVARCHAR(200) NOT NULL);

	INSERT INTO @CD_Plan ([Id], [Name]) VALUES (0, N'Free')
	INSERT INTO @CD_Plan ([Id], [Name]) VALUES (1, N'Premium')


	MERGE INTO dbo.[CD_Plan] AS TARGET  
	USING @CD_Plan AS SOURCE  
	ON TARGET.[Id] = SOURCE.[Id]  
	WHEN MATCHED THEN    
	UPDATE SET [Name] = SOURCE.[Name]
	WHEN NOT MATCHED BY TARGET THEN   
	INSERT ([Id], [Name])   
	VALUES (SOURCE.[Id], SOURCE.[Name])  
	OUTPUT $action, SOURCE.*;
	
	SET IDENTITY_INSERT dbo.[CD_Plan] OFF	
	
	
	--08. Add rows to @CD_Profile_Events
	DECLARE @CD_Profile_Events TABLE ([ProfileId] TINYINT NOT NULL, [EventCode] SMALLINT NOT NULL);
	
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 44)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 44)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 44)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 44)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 44)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 44)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 44)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 44)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 1)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 1)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 1)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 1)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 1)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 1)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 1)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 1)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 3)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 3)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 3)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 3)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 3)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 3)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 3)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 3)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 4)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 4)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 4)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 4)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 4)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 4)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 4)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 4)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 8)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 8)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 8)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 8)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 8)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 8)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 8)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 8)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 11)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 11)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 11)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 11)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 11)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 11)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 11)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 11)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 15)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 15)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 15)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 15)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 15)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 15)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 15)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 15)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 20)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 20)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 20)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 20)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 20)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 20)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 20)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 20)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 24)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 24)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 24)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 24)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 24)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 24)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 24)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 24)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 101)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 101)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 101)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 101)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 101)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 101)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 101)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 101)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 104)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 104)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 104)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 104)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 104)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 104)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 104)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 104)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 107)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 107)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 107)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 107)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 107)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 107)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 107)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 107)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 23)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 23)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 27)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 27)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 27)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 27)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 27)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 27)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 27)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 27)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 37)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 37)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 503)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 503)	
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 10)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 10)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 38)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 38)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 504)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 504)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 2)
	-- INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 2)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 2)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 2)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 2)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 2)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 2)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 2)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 9)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 9)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 9)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 9)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 9)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 9)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 9)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 9)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 12)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 12)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 12)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 12)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 12)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 12)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 12)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 12)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 13)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 13)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 14)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 14)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 21)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 21)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 22)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 22)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 26)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 26)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 26)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 26)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 26)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 26)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 26)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 26)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 28)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 28)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 28)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 28)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 28)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 28)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 28)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 28)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 102)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 102)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 102)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 102)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 102)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 102)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 102)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 102)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 103)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 103)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 103)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 103)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 103)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 103)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 103)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 103)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 105)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 105)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 105)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 105)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 105)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 105)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 105)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 105)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 106)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 106)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 106)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 106)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 106)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 106)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 106)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 106)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 108)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 108)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 108)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 108)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 108)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 108)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 108)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 108)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 109)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 109)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 109)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 109)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 109)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 109)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 109)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 109)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 201)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 201)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 201)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 201)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 201)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 201)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 201)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 201)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 202)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 202)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 202)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 202)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 202)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 202)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 202)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 202)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 204)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 204)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 206)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 206)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 212)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 212)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 305)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 305)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 305)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 305)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 305)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 305)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 305)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 305)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 406)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 406)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 406)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 406)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 501)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 501)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 502)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 502)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 6)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 6)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 6)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 6)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 6)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 6)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 6)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 6)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 1010)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 1010)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 1010)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 1010)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 1010)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 1010)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 1010)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 1010)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 207)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 207)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 210)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 210)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 304)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 304)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 315)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 315)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 850)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 850)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 850)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 850)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 851)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 851)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 851)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 851)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 852)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 852)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 852)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 852)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 853)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 853)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 853)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 853)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 854)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 855)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 857)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 858)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 860)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 860)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 860)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 860)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 861)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 861)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 861)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 861)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 862)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 862)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 862)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 862)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 863)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 863)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 863)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 863)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 864)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 865)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 867)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 868)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 203)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 203)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 205)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 205)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 211)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 211)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 150)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 150)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 150)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 150)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 150)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 150)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 150)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 150)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 151)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 151)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 151)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 151)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 151)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 151)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 151)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 151)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 152)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 152)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 152)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 152)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 152)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 152)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 152)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 152)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 705)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 705)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 705)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 705)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 705)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 705)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 705)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 705)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (1, 706)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (2, 706)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (3, 706)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (4, 706)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (5, 706)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (6, 706)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (7, 706)
	INSERT INTO @CD_Profile_Events (ProfileId, EventCode) VALUES (8, 706)
	
	MERGE INTO dbo.[CD_Profile_Events] AS TARGET  
	USING @CD_Profile_Events AS SOURCE  
	ON TARGET.[ProfileId] = SOURCE.[ProfileId]  and TARGET.[EventCode] = SOURCE.[EventCode]
	WHEN MATCHED THEN    
	UPDATE SET [EventCode] = SOURCE.[EventCode]
	WHEN NOT MATCHED BY TARGET THEN   
	INSERT ([ProfileId], [EventCode])   
	VALUES (SOURCE.[ProfileId], SOURCE.[EventCode])  
	OUTPUT $action, SOURCE.*;	
	
	--09. Add rows to @CD_NotificationGroups
	DECLARE @CD_NotificationGroups TABLE ([NotificationGroupId] INT NOT NULL, [NotificationGroupDescription] NVARCHAR(250));

	INSERT INTO @CD_NotificationGroups (NotificationGroupId, NotificationGroupDescription) VALUES (1, 'INFORMATION')
	INSERT INTO @CD_NotificationGroups (NotificationGroupId, NotificationGroupDescription) VALUES (2, 'ALARM')
	INSERT INTO @CD_NotificationGroups (NotificationGroupId, NotificationGroupDescription) VALUES (3, 'ARM')
	INSERT INTO @CD_NotificationGroups (NotificationGroupId, NotificationGroupDescription) VALUES (4, 'DISARM')
	INSERT INTO @CD_NotificationGroups (NotificationGroupId, NotificationGroupDescription) VALUES (5, 'MAINTANANCE')
	INSERT INTO @CD_NotificationGroups (NotificationGroupId, NotificationGroupDescription) VALUES (6, 'PHOTO/VIDEO COMFORT')
	INSERT INTO @CD_NotificationGroups (NotificationGroupId, NotificationGroupDescription) VALUES (7, 'PHOTO/VIDEO ALARM')
	INSERT INTO @CD_NotificationGroups (NotificationGroupId, NotificationGroupDescription) VALUES (8, 'TECHNICAL')
	
	MERGE INTO dbo.[CD_NotificationGroups] AS TARGET  
	USING @CD_NotificationGroups AS SOURCE  
	ON TARGET.[NotificationGroupId] = SOURCE.NotificationGroupId  and TARGET.[NotificationGroupDescription] = SOURCE.[NotificationGroupDescription]
	WHEN MATCHED THEN    
	UPDATE SET [NotificationGroupDescription] = SOURCE.[NotificationGroupDescription]
	WHEN NOT MATCHED BY TARGET THEN   
	INSERT (NotificationGroupId, NotificationGroupDescription)   
	VALUES (SOURCE.[NotificationGroupId], SOURCE.NotificationGroupDescription)  
	OUTPUT $action, SOURCE.*;
	
	--Add rows to dbo.[CD_Event]
SET IDENTITY_INSERT [dbo].[CD_Event] ON 

if not exists(select 1 from [dbo].[CD_Event])
BEGIN
	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (0, 0, N'Unknown', N'Unknown Event', NULL, NULL, 5, 1)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1, 0, N'BurglaryAlarm', N'Burglary alarm', N'(?<ArmingType>[HIEWP]{1})(?<DeviceId>\d{3})(?<DetectionLevel>(\d{3})?)', NULL, 2, 2)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (2, 0, N'BurglaryAlarmReset', N'Burglary alarm reset', N'(?<ArmingType>[HIEWP]{1})(?<DeviceId>\d{3})(?<DetectionLevel>(\d{3})?)', NULL, 1, 3)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (3, 0, N'PanicAlarm', N'Panic alarm', N'(?<IsRemotePanic>[01]{1})(?<DeviceId>\d{3})(?<UserId>\d{3})', NULL, 2, 4)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (4, 0, N'DuressAlarm', N'Duress Alarm', N'(?<DeviceId>\d{3})', NULL, 2, 5)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (5, 0, N'BurglaryAlarmCancelled', N'Burglary alarm cancelled', N'(?<DeviceId>\d{3})(?<UserId>\d{3})', NULL, 1, 6)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (6, 0, N'GuardCodeEntered', N'The Guard Code Has Been Entered', N'(?<UseType>[12]{1})(?<DeviceId>\d{3})', NULL, 5, 7)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (7, 0, N'NewGuardCode', N'A New Guard Code Has Been Created', N'(?<GuardUserCode>\d{4})', NULL, 5, 8)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (8, 0, N'TamperAlarm', N'Tamper alarm', N'(?<TamperPosition>\d{1})(?<DeviceId>\d{3})', NULL, 2, 9)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (9, 0, N'TamperReset', N'Tamper device was reset', N'(?<TamperPosition>\d{1})(?<DeviceId>\d{3})', NULL, 1, 10)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (10, 0, N'ExternalDisarm', N'Remote Disarm', N'(?<DisarmType>[12]{1})(?<PhoneNumber>\d{9})', NULL, 4, 11)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (11, 0, N'JammingDetected', N'Jamming Detected', N'(?<JammingType>[12]{1})(?<MinutesInJamming>\d{3})', NULL, 2, 12)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (12, 0, N'JammingRestored', N'Jamming Ended', N'(?<JammingType>[12]{1})(?<MinutesInJamming>\d{3})', NULL, 1, 13)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (13, 0, N'DeviceBypassed', N'A Security Zone Has Been Bypassed', N'(?<BypassMethod>[123]{1})(?<DeviceId>\d{3})(?<BypassTimeInHours>\d{5})', NULL, 1, 14)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (14, 0, N'DeviceUnbypassed', N'A Security Zone Has Been Unbypassed', N'(?<BypassMethod>[123]{1})(?<DeviceId>\d{3})(?<BypassTimeInHours>\d{5})', NULL, 1, 15)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (15, 0, N'UserCodeTamper', N'Too Many Wrong User Codes Entered', N'(?<DeviceId>\d{3})', NULL, 2, 16)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (16, 0, N'BeginLocalProgramming', N'Start of Local Programming', NULL, NULL, 5, 17)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (17, 0, N'BeginRemoteProgramming', N'Start of Remote Programming', N'(?<AccessType>[23]{1})', NULL, 5, 18)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (18, 0, N'EndOfLocalProgramming', N'End ofLocal Programming', NULL, NULL, 5, 19)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (19, 0, N'EndOfRemoteProgramming', N'End of Remote Programming', N'(?<AccessType>[23]{1})', NULL, 5, 20)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (20, 0, N'PerimeterAlarm', N'Perimetral Detection situation', N'(?<DeviceId>\d{3})(?<DetectionIntervalInMinutes>\d{5})(?<DetectionLevel>\d{3})', NULL, 2, 21)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (21, 0, N'StopSiren', N'Siren stopped', N'(?<StopMethod>[1-2]{1})', NULL, 1, 22)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (22, 0, N'DoorLockRemoteRequest', N'Control panel informs of open remote request', N'(?<DoorLockRemoteRequestMethod>[1-2]{1})(?<DeviceId>\d{3})', NULL, 1, 23)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (23, 0, N'ExternalArm', N'Remote Arm', N'(?<ArmType>[1-3]{1})', NULL, 3, 24)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (24, 0, N'DeviceCableSabotage', N'Panel Inform about a cable Device Sabotage', N'(?<DeviceId>\d{3})', NULL, 2, 25)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (25, 0, N'SirenStarted', N'Siren started', NULL, NULL, NULL, 26)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (26, 0, N'DeviceCableSabotageRestored', N'Device Cable Sabotage Restored', NULL, NULL, 1, 27)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (27, 0, N'InactivityAlarm', N'Inactivity Alarm', NULL, NULL, 2, 28)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (28, 0, N'InactivityAlarmReset', N'Inactivity Alarm Restored', NULL, NULL, 1, 29)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (29, 0, N'PerimeterAlarmReset', N'Perimeter Alarm Restored', NULL, NULL, NULL, 30)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (35, 0, N'DeviceTemporarilyBypassed', N'Device bypass (force-arm)', NULL, NULL, NULL, 31)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (36, 0, N'DeviceTemporarilyUnbypassed', N'Temporary device bypass reset (due to disarm)', NULL, NULL, NULL, 32)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (39, 0, N'RegularUserArm', N'System was armed', NULL, NULL, NULL, 33)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (40, 0, N'RegularUserDisarm', N'System was disarmed', NULL, NULL, NULL, 34)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (44, 0, N'TamperWhenArmed', N'Device tampered (in arm state)', NULL, NULL, NULL, 35)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (45, 0, N'DelayedUserArm', N'Delayed User Arm', NULL, NULL, NULL, 36)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (51, 0, N'ControlledUserForceArm', N'System armed (forced)', NULL, NULL, NULL, 37)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (55, 0, N'ControlledUserPartArm', N'Controlled User Part Arm', NULL, NULL, NULL, 38)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (56, 0, N'ControlledUserDayArm', N'System armed (day)', NULL, NULL, NULL, 39)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (57, 0, N'ControlledUserNightArm', N'System armed (night)', NULL, NULL, NULL, 40)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (58, 0, N'ControlledUserDayForceArm', N'Controlled User Day Force Arm', NULL, NULL, NULL, 41)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (59, 0, N'ControlledUserNightForceArm', N'Controlled User Night Force Arm', NULL, NULL, NULL, 42)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (101, 0, N'FireAlarm', N'Fire alarm', N'(?<ArmingType>[HIEWP]{1})(?<DeviceId>\d{3})(?<DetectionLevel>(\d{3})?)', NULL, 2, 43)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (102, 0, N'FireAlarmReset', N'Fire detector subsided', N'(?<ArmingType>[HIEWP]{1})(?<DeviceId>\d{3})(?<DetectionLevel>(\d{3})?)', NULL, 1, 44)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (103, 0, N'FireAlarmCancelled', N'Fire alarm cancelled', N'(?<DeviceId>\d{3})(?<UserId>\d{3})', NULL, 1, 45)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (104, 0, N'WaterLeakageAlarm', N'Flood alarm', N'(?<ArmingType>[HIEWP]{1})(?<DeviceId>\d{3})(?<DetectionLevel>(\d{3})?)', NULL, 2, 46)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (105, 0, N'WaterLeakageAlarmReset', N'Flood detector subsided', N'(?<ArmingType>[HIEWP]{1})(?<DeviceId>\d{3})(?<DetectionLevel>(\d{3})?)', NULL, 1, 47)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (106, 0, N'WaterLeakageAlarmCancelled', N'Flood Alarm cancelled', N'(?<DeviceId>\d{3})(?<UserId>\d{3})', NULL, 1, 48)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (107, 0, N'GasAlarm', N'Gas Alarm', N'(?<ArmingType>[HIEWP]{1})(?<DeviceId>\d{3})(?<DetectionLevel>(\d{3})?)', NULL, 2, 49)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (108, 0, N'GasAlarmReset', N'Gas Alarm Reset', N'(?<ArmingType>[HIEWP]{1})(?<DeviceId>\d{3})(?<DetectionLevel>(\d{3})?)', NULL, 1, 50)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (109, 0, N'GasAlarmCancelled', N'Gas Alarm Cancelled', N'(?<DeviceId>\d{3})(?<UserId>\d{3})', NULL, 1, 51)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (110, 0, N'ExtremeTemperatureAlarm', N'Extreme Temperature Detected', NULL, NULL, NULL, 52)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (111, 0, N'ExtremeTemperatureAlarmReset', N'Extreme Temperature Situation Reset', NULL, NULL, NULL, 53)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (150, 0, N'SafetyAlarm', N'Safety alarm', N'(?<ArmingType>[HIEWP]{1})(?<DeviceId>\d{3})(?<DetectionLevel>(\d{3})?)', NULL, NULL, 54)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (151, 0, N'SafetyAlarmReset', N'Safety alarm subsided', N'(?<ArmingType>[HIEWP]{1})(?<DeviceId>\d{3})(?<DetectionLevel>(\d{3})?)', NULL, NULL, 55)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (152, 0, N'SafetyAlarmCancelled', N'Safety alarm cancelled', N'(?<DeviceId>\d{3})(?<UserId>\d{3})', NULL, NULL, 56)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (153, 0, N'OtherAlarm', N'Other Alarm', N'(?<ArmingType>[HIEWP]{1})(?<DeviceId>\d{3})(?<DetectionLevel>(\d{3})?)', NULL, 2, 57)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (154, 0, N'OtherAlarmReset', N'Other Alarm Reset', NULL, NULL, NULL, 58)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (155, 0, N'OtherAlarmCancelled', N'Other Alarm Cancelled', N'(?<DeviceId>\d{3})(?<UserId>\d{3})', NULL, 1, 59)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (156, 0, N'PanicAlarmCancelled', N'Panic alarm cancelled', N'(?<DeviceId>\d{3})(?<UserId>\d{3})', NULL, NULL, 60)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (201, 0, N'PowerFailure', N'AC Power Failure in Control Panel', N'(?<MinutesInFault>\d{3})', NULL, 1, 61)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (202, 0, N'PowerRestored', N'AC Power Restored to Control Panel', N'(?<MinutesInFault>\d{3})', NULL, 1, 62)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (203, 0, N'LowBattery', N'Low battery', N'(?<DeviceId>\d{3})', NULL, 8, 63)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (204, 0, N'LowBatteryReset', N'New batteries', N'(?<DeviceId>\d{3})', NULL, 1, 64)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (205, 0, N'EmptyBattery', N'Empty battery in panel', N'(?<DeviceId>\d{3})', NULL, 8, 65)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (206, 0, N'EmptyBatteryReset', N'Battery restored in panel', N'(?<DeviceId>\d{3})', NULL, 1, 66)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (207, 0, N'CommunicationFault', N'Event Transmission Failed', N'((?<TransmissionType>[ASITV]{1})(?<MinutesInFault>\d{5}))|((?<TransmissionType>[0-9A-F]{2})(?<MinutesInFault>[0-9A-F]{3}))', NULL, 1, 67)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (208, 0, N'NewOperativeCode', N'New Operative Code', N'(?<OperativeCode>\d{4})', NULL, 5, 68)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (209, 0, N'ChangeConfigurationInProgram', N'System Configuration Has Been Programmatically Changed', N'(?<ChangeType>[1-4]{1})(?<ObjectChanged>[1-5]{1})', NULL, 8, 69)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (210, 0, N'TransmitterFault', N'Line Level Faults', N'(?<TransmitterType>[1-5]{1})(?<FaultLevel>\d{2})(?<MinutesPolled>\d{3})', NULL, 1, 70)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (211, 0, N'Connection loss', N'Connection loss detected on', N'(?<DeviceId>\d{3})', NULL, 8, 71)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (212, 0, N'SupervisionRestored', N'Connection to device was restored', N'(?<DeviceId>\d{3})', NULL, 1, 72)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (213, 0, N'ApnFailed', N'APN Login Failed', NULL, NULL, NULL, 73)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (214, 0, N'ApnRestored', N'APN Login Restored', NULL, NULL, NULL, 74)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (215, 0, N'BatteryRemovedOrRestoredEvent', N'Device battery was removed', N'(?<DeviceId>\d{3})', NULL, NULL, 75)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (216, 0, N'BatteryRemovedOrRestoredEvent', N'Device battery was restored', N'(?<DeviceId>\d{3})', NULL, NULL, 76)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (217, 0, N'DevicePowerUp', N'Device Power Up', NULL, NULL, NULL, 77)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (218, 0, N'PanelSimCardReady', N'SIM card became available', NULL, NULL, NULL, 78)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (219, 0, N'PanelSimCardError', N'SIM card became unavailable', NULL, NULL, NULL, 79)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (220, 0, N'PanelSwitchedToBackupLink', N'Panel switched to backup communication link', NULL, NULL, NULL, 80)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (221, 0, N'PanelPrimaryLinkRestored', N'Panel switched back to primary communication link', NULL, NULL, NULL, 81)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (301, 0, N'GSMLevel', N'GSM reception level', N'(?<Coverage>\d{3})', NULL, 8, 82)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (302, 0, N'PanelCommunicationStatus', N'Status of Communication between Control Panel and CMS', N'(?<Status>[1-3]{1})', NULL, 8, 83)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (303, 0, N'ControlPanelArmingUsage', N'Control Panel Arming Statistics', N'(?<TotalArming>\d{4})(?<PartialArming>\d{4})(?<PerimeterArming>\d{4})', NULL, 5, 84)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (304, 0, N'PanelReleaseInformation', N'Control Panel Release Information', N'(?<MainSoftware>[0-9A-Z]{5})(?<RFSoftware>[0-9A-Z]{5})', NULL, 5, 85)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (305, 0, N'CallCMS', N'Call CMS Led Indicator', N'(?<LedStatus>\d{1})', NULL, 1, 86)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (306, 0, N'PerimetralFlashFunction', N'Panel informs of perimetral flash status', N'(?<PerimetralFlashFunctionStatus>[0-1]{1})(?<DeviceId>\d{3})', NULL, 1, 87)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (307, 0, N'PerimetralVoiceFunction', N'Panel informs of perimetral voice status', N'(?<PerimetralVoiceFunctionStatus>[0-1]{1})(?<DeviceId>\d{3})', NULL, NULL, 88)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (308, 0, N'HomeAutomationStatus', N'Control panel informs of status of Home Automation Status Devices', N'(?<HomeAutomationStatus>[0-2]{1})(?<DeviceId>\d{3})', NULL, NULL, 89)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (309, 0, N'DoorLockStatus', N'Control panel informs of status of Door lock', N'(?<DoorLockStatus>[0-2]{1})(?<DeviceId>\d{3})', NULL, 1, 90)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (310, 0, N'HomeAutomationRemoteRequest', N'Control panel informs of  remote request', N'(?<HomeAutomationRemoteRequestMethod>[1-2]{1})(?<HomeAutomationRemoteRequestStatus>[0-2]{1})(?<DeviceId>\d{3})', NULL, 1, 91)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (311, 0, N'EntryInIpListening', N'Entry In Ip Listening', NULL, NULL, 8, 92)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (312, 0, N'PanelStatus', N'Panel status transmitted', NULL, NULL, NULL, 93)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (313, 0, N'BatteryLevel', N'Battery level:', NULL, NULL, NULL, 94)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (314, 0, N'ACPowerStatus', N'Panel mains power status changed', NULL, NULL, NULL, 95)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (315, 0, N'DeviceReleaseInformation', N'Device Release Information', NULL, NULL, 5, 96)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (318, 0, N'RemoteSystemResetInformation', N'Remote System Reset Information', NULL, NULL, NULL, 97)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (319, 0, N'CommunicationModuleInformation', N'Communication Module Information', NULL, NULL, NULL, 98)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (320, 0, N'InactivityAndChimeInformation', N'Inactivity And Chime Information', NULL, NULL, NULL, 99)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (321, 0, N'InactivityTimeInformation', N'Inactivity Time Information', NULL, NULL, NULL, 100)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (322, 0, N'DtmfCodeInformation', N'Dtmf Code Information', NULL, NULL, NULL, 101)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (323, 0, N'PhotoVideoTransmissionScenarioInformation', N'Photo/Video Transmission Scenario Information', NULL, NULL, NULL, 102)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (324, 0, N'JammingConfigurationInformation', N'Jamming Configuration Information', NULL, NULL, NULL, 103)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (325, 0, N'SystemUsageInformation', N'System Usage Information', NULL, NULL, NULL, 104)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (326, 0, N'ReleaseInformation', N'Release Information', NULL, NULL, NULL, 105)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (327, 0, N'SoftResetInfromation', N'Soft Reset Infromation', NULL, NULL, NULL, 106)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (328, 0, N'PeripheralsTechnicalStatusInformation', N'Peripherals Technical Status Information', NULL, NULL, NULL, 107)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (329, 0, N'CallButtonInformation', N'Control panel informs of call button status', NULL, NULL, NULL, 108)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (330, 0, N'RemoteSoftwareUpdateStatus', N'Software update status changed', NULL, NULL, NULL, 109)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (331, 0, N'JammingDetectionProgram', N'Jamming Detection Program', NULL, NULL, NULL, 110)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (332, 0, N'TimeZoneCheckEvent', N'Time Zone Check Event', NULL, NULL, NULL, 111)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (333, 0, N'TimeZoneDataChangedEvent', N'Time Zone Data Changed Event', NULL, NULL, NULL, 112)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (334, 0, N'PanelNetworkStatus', N'Network status', NULL, NULL, NULL, 113)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (335, 0, N'TimeZoneUpdateEvent', N'Time zone update event', NULL, NULL, NULL, 114)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (336, 0, N'PanelConfigurationUpdate', N'Panel Configuration Update ', NULL, NULL, NULL, 115)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (401, 0, N'SecurityVideoInPanel', N'A Security Video Has Been Stored in the Control Panel', N'((?<DeviceId>\d{3})(?<FileName>.{24,30}))|(?<FileName>\d{15})', NULL, 7, 116)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (402, 0, N'ComfortVideoInPanel', N'A Comfort Video Has Been Stored in the Control Panel', N'((?<DeviceId>\d{3})(?<FileName>.{24,30}))|(?<FileName>\d{15})', NULL, 6, 117)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (403, 0, N'PreAlarmVideoInPanel', N'A Pre-Alarm Video Has Been Stored in the Control Panel', N'((?<DeviceId>\d{3})(?<FileName>.{24,30}))|(?<FileName>\d{15})', NULL, 7, 118)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (404, 0, N'SecurityVideoInCMS', N'A Security Video Has Been Sent to the CMS', N'((?<DeviceId>\d{3})(?<FileName>.{24,30}))|(?<FileName>\d{15})', NULL, 7, 119)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (405, 0, N'PreAlarmVideoInCMS', N'A Pre-Alarm Video Has Been Sent to the CMS', N'((?<DeviceId>\d{3})(?<FileName>.{24,30}))|(?<FileName>\d{15})', NULL, 7, 120)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (406, 0, N'VideoCaptureFailure', N'Error in photo/video capture', N'(?<Reason>\d{1})(?<DeviceId>\d{2})?', NULL, 1, 121)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (407, 0, N'ComfortVideoInCms', N'Comfort Video In Cms', NULL, NULL, 6, 122)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (408, 0, N'LastVideoDetectionsInformation', N'Last Video Detections Information', NULL, NULL, 5, 123)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (410, 0, N'NewVideoInWeRSystem', N'Video segment arrived', NULL, NULL, NULL, 124)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (411, 0, N'VideoMessageEnded', N'Comfort video available', NULL, NULL, NULL, 125)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (412, 0, N'VideoClipMessageEnded', N'Security video available', NULL, NULL, NULL, 126)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (413, 0, N'SecurityVideoInPanelFirstPicture', N'Single Picture of a Security Photo Set  Has Been Stored in the Control Panel', NULL, NULL, NULL, 127)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (414, 0, N'ComfortVideoInPanelFirstPicture', N'Single Picture of a Comfort Photo Set  Has Been Stored in the Control Panel', NULL, NULL, NULL, 128)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (415, 0, N'SecurityVideoInCmsFirstPicture', N'Single Picture of a Security Photo Set  Has Been Sent to the CMS', NULL, NULL, NULL, 129)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (416, 0, N'PreAlarmVideoInCmsFirstPicture', N'Single Picture of a Perimeter Photo Set  Has Been Sent to the CMS', NULL, NULL, NULL, 130)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (417, 0, N'PreAlarmVideoInPanelFirstPicture', N'Single Picture of a Perimeter Photo Set  Has Been Stored in the Control Panel', NULL, NULL, NULL, 131)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (418, 0, N'RuleVideoClipMessageEnded', N'Rule comfort video available', NULL, NULL, NULL, 132)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (501, 0, N'EmployeeEntry', N'An Employee Has Entered the Premises', N'(?<DeviceId>\d{3})(?<UserId>\d{3})', NULL, 1, 133)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (502, 0, N'EmployeeExit', N'An Employee Has Exited the Premises', N'(?<DeviceId>\d{3})(?<UserId>\d{3})', NULL, 1, 134)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (503, 0, N'ControlledUserArm', N'A Controlled User (Attendant) Has Armed the Control Panel', N'(?<DeviceId>\d{3})(?<UserId>\d{3})', NULL, 3, 135)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (504, 0, N'ControlledUserDisarm', N'A Controlled User (Attendant) Has Disarmed the Control Panel', N'(?<DeviceId>\d{3})(?<UserId>\d{3})', NULL, 4, 136)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (505, 0, N'CallButtonPressed', N'Call CMS was pressed by User', NULL, NULL, NULL, 137)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (510, 0, N'DoorOpened', N'Door open (when disarmed)', NULL, NULL, NULL, 138)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (511, 0, N'DoorClosed', N'Door closed (when disarmed)', NULL, NULL, NULL, 139)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (512, 0, N'IpdWalkingThrough', N'Ipd Walking Through', NULL, NULL, NULL, 140)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (601, 0, N'CentralTamperProgramInformation', N'Central Tamper Program Information', NULL, NULL, NULL, 141)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (602, 0, N'CentralUserInformation', N'Central User Information', NULL, NULL, NULL, 142)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (603, 0, N'HomeAutomationDevicesInformation', N'Home Automation Devices Information', NULL, NULL, NULL, 143)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (604, 0, N'IntrusionDeviceInformation', N'Intrusion Device Information', NULL, NULL, NULL, 144)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (605, 0, N'KeypadsInformation', N'Keypads Information', NULL, NULL, NULL, 145)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (606, 0, N'PerimetralDeviceInformation', N'Perimetral Device Information', NULL, NULL, NULL, 146)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (607, 0, N'ProgramIncomingCalls', N'Program Incoming Calls', NULL, NULL, NULL, 147)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (608, 0, N'ProgramKeyButtonEvent', N'Program Key Button Event', NULL, NULL, NULL, 148)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (609, 0, N'ProgramOutgoingCalls', N'Program Outgoing Calls', NULL, NULL, NULL, 149)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (610, 0, N'ProgramPanelConfiguration', N'Program Panel Configuration', NULL, NULL, NULL, 150)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (611, 0, N'ProgramTag', N'Program Tag', NULL, NULL, NULL, 151)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (612, 0, N'SimNumber', N'Sim Number', NULL, NULL, NULL, 152)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (613, 0, N'UserDevicesFromPanelInformation', N'User Devices From Panel Information', NULL, NULL, NULL, 153)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (614, 0, N'UserDevicesInformation', N'User Devices Information', NULL, NULL, NULL, 154)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (615, 0, N'MaintenanceConfigurationInformation', N'Maintenance Configuration Information Event', NULL, NULL, NULL, 155)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (616, 0, N'PingDestination', N'Ping Destination Event', NULL, NULL, NULL, 156)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (617, 0, N'NetworkConnectivityInformation', N'Network Connectivity Information Event', NULL, NULL, NULL, 157)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (618, 0, N'PingPeriodicitySettingInformation', N'Ping Periodicity Setting Information Event', NULL, NULL, NULL, 158)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (619, 0, N'JDRFLinkLoss', N'JDRF Link Loss Event', NULL, NULL, NULL, 159)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (620, 0, N'CommunicationModuleInformationV2', N'Communication Module Information V2 Event', NULL, NULL, NULL, 160)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (621, 0, N'GSMCommunicationMaintenanceStatusInformation', N'GSM Communication Maintenance Status Information Event', NULL, NULL, NULL, 161)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (622, 0, N'GSMLedStatus', N'GSM LED Status', NULL, NULL, NULL, 162)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (623, 0, N'TemperatureBatchReportEvent', N'Temperature Batch Report Event', NULL, NULL, NULL, 163)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (624, 0, N'SigFoxParametersEvent', N'Sig Fox Parameters Event', NULL, NULL, NULL, 164)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (625, 0, N'SigFoxPeriodEvent', N'Sig Fox Period Event', NULL, NULL, NULL, 165)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (701, 0, N'SelfTestEvent', N'SelfTestEvent', N'(?<Token>[0-9A-F-]{36})', NULL, 1, 166)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (703, 0, N'SuspendService', N'Services have been suspended for this account', NULL, NULL, NULL, 167)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (704, 0, N'ResumeService', N'Services have been resumed for this account', NULL, NULL, NULL, 168)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (705, 0, N'PanelOnline', N'Panel Is Online', NULL, NULL, NULL, 169)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (706, 0, N'PanelOffline', N'Panel Is Offline', NULL, NULL, NULL, 170)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (707, 0, N'EncriptionKeyVerification', N'Encription Key Verification', NULL, NULL, NULL, 171)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (801, 0, N'ResponseToUserCommand', N'User operation status transmitted', NULL, NULL, 5, 172)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (802, 0, N'WeRActivationRequest', N'We.R system activation requested', NULL, NULL, NULL, 173)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (803, 0, N'SuccessfulWeRActivation', N'We.R system finalized activation', NULL, NULL, NULL, 174)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (850, 0, N'ServerVideoAlarm', N'Alarm Video in Server', NULL, NULL, 7, 175)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (851, 0, N'ServerVideoPreAlarm', N'Perimeter Video in Server', NULL, NULL, 7, 176)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (852, 0, N'ServerSdOpVidAlrmReq', N'Operator Requested Security Video in Server', NULL, NULL, 7, 177)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (853, 0, N'ServerSdOpVidAlrmReqAll', N'Operator Requested Video Round in Server', NULL, NULL, 7, 178)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (854, 0, N'ServerVideoSuspicious', N'Suspect Video in Server', NULL, NULL, 6, 179)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (855, 0, N'ServerVideoOpenClose', N'Open/Close Video in Server', NULL, NULL, 6, 180)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (856, 0, N'ServerVideoEmployeeControl', N'Employee Control Video in Server', NULL, NULL, NULL, 181)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (857, 0, N'ServerVideoUserRequest', N'User Requested Video in Server', NULL, NULL, 6, 182)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (858, 0, N'ServerVideoTeleSurv', N'User Requested Video Round in Server', NULL, NULL, 6, 183)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (859, 0, N'ServerEventTriggeredVideo', N'Server Event Triggered Video', NULL, NULL, 7, 184)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (860, 0, N'ServerPhotoAlarm', N'Alarm Photo in Server', NULL, NULL, 7, 185)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (861, 0, N'ServerPhotoPreAlarm', N'Perimeter Photo in Server', NULL, NULL, 7, 186)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (862, 0, N'ServerSdOpPhoAlrmReq', N'Operator Requested Security Photo in Server', NULL, NULL, 7, 187)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (863, 0, N'ServerSdOpPhoAlrmReqAll', N'Operator Requested Photo Round in Server', NULL, NULL, 7, 188)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (864, 0, N'ServerPhotoSuspicious', N'Suspect Photo in Server', NULL, NULL, 6, 189)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (865, 0, N'ServerPhotoOpenClose', N'Open/Close Photo in Server', NULL, NULL, 6, 190)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (866, 0, N'ServerPhotoEmployeeControl', N'Employee Control Photo in Server', NULL, NULL, 7, 191)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (867, 0, N'ServerPhotoUserRequest', N'User Requested Photo in Server', NULL, NULL, 6, 192)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (868, 0, N'ServerPhotoTeleSurv', N'User Requested Photo Round in Server', NULL, NULL, 6, 193)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (869, 0, N'ServerEventTriggeredPhoto', N'Server Event Triggered Photo', NULL, NULL, 7, 194)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (901, 0, N'NewUser', N'New user created', NULL, NULL, NULL, 195)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (902, 0, N'UserDataRefreshed', N'User information sent by panel', NULL, NULL, NULL, 196)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (903, 0, N'UserDeleted', N'User was deleted from the system', NULL, NULL, NULL, 197)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (904, 0, N'NewSecurityDevice', N'New security device', NULL, NULL, NULL, 198)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (905, 0, N'SecurityDeviceDataRefreshed', N'Security device information sent by panel', NULL, NULL, NULL, 199)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (906, 0, N'SecurityDeviceDeleted', N'Security device was deleted from the system', NULL, NULL, NULL, 200)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (907, 0, N'NewKeyFob', N'New key fob', NULL, NULL, NULL, 201)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (908, 0, N'KeyFobDataRefreshed', N'Key fob device information sent by panel', NULL, NULL, NULL, 202)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (909, 0, N'KeyFobDeleted', N'Key fob was deleted from the system', NULL, NULL, NULL, 203)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (910, 0, N'NewSiren', N'New siren', NULL, NULL, NULL, 204)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (911, 0, N'SirenDataRefreshed', N'Siren device information sent by panel', NULL, NULL, NULL, 205)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (912, 0, N'SirenDeleted', N'Siren was deleted from the system', NULL, NULL, NULL, 206)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (913, 0, N'NewTag', N'New tag', NULL, NULL, NULL, 207)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (914, 0, N'TagDataRefreshed', N'Tag information sent by panel', NULL, NULL, NULL, 208)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (915, 0, N'TagDeleted', N'Tag was deleted from the system', NULL, NULL, NULL, 209)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (916, 0, N'NewRFInputDevice', N'New safety device', NULL, NULL, NULL, 210)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (917, 0, N'RFInputDeviceDataRefreshed', N'Safety device information sent by panel', NULL, NULL, NULL, 211)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (918, 0, N'RFInputDeviceDeleted', N'Safety device was deleted from the system', NULL, NULL, NULL, 212)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (919, 0, N'NewTagReader', N'Control panel informs of a new tag reader', NULL, NULL, NULL, 213)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (920, 0, N'TagReaderDataRefreshed', N'Control panel sends tag reader information', NULL, NULL, NULL, 214)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (921, 0, N'TagReaderDeleted', N'Control panel informs of a deletion of a tag reader', NULL, NULL, NULL, 215)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (922, 0, N'NewRfOutputDevice', N'New Rf Output Device', NULL, NULL, NULL, 216)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (923, 0, N'SmartPlugDeviceDataRefreshed', N'Smart Plug Device Data Refreshed', NULL, NULL, NULL, 217)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (924, 0, N'RfOutputDeviceDeleted', N'Rf Output Device Deleted', NULL, NULL, NULL, 218)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (925, 0, N'NewIpCamera', N'New IP Camera', NULL, NULL, NULL, 219)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (926, 0, N'IpCameraDeleted', N'IP Camera Deleted', NULL, NULL, NULL, 220)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1000, 0, N'BackOfficeOperatorAccess', N'Kit information reviewed', NULL, NULL, NULL, 221)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1001, 0, N'BackOfficeOperatorReset', N'Kit was reset', NULL, NULL, NULL, 222)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1002, 0, N'BackOfficeOperatorHistoryView', N'Kit history reviewed', NULL, NULL, NULL, 223)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1010, 0, N'DeviceTamper', N'Device was tampered', NULL, NULL, NULL, 224)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1020, 0, N'StopSirenByUserRequest', N'Siren stopped due to user request', NULL, NULL, NULL, 225)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1022, 0, N'DoorLockActivationRequest', N'Door Lock Activation Request', NULL, NULL, NULL, 226)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1101, 0, N'RealTimeMetering', N'Real Time Metering', NULL, NULL, NULL, 227)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1102, 0, N'ContinuousMetering', N'Continuous Metering', NULL, NULL, NULL, 228)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1103, 0, N'PeakDetected', N'Peak Detected', NULL, NULL, NULL, 229)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1104, 0, N'SmartPlugTechnicalProblem', N'Smart Plug Technical Problem', NULL, NULL, NULL, 230)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1105, 0, N'RelayStatusOn', N'Relay Status On', NULL, NULL, NULL, 231)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1106, 0, N'RelayStatusOff', N'Relay Status Off', NULL, NULL, NULL, 232)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1107, 0, N'ApplianceConnected', N'Appliance Connected', NULL, NULL, NULL, 233)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1108, 0, N'ApplianceDisconnected', N'Appliance Disconnected', NULL, NULL, NULL, 234)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1109, 0, N'SmartPlugScenarioUpdated', N'Smart Plug Scenario Updated', NULL, NULL, NULL, 235)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1110, 0, N'SurgeProtectionBlown', N'Surge Protection Blown', NULL, NULL, NULL, 236)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1200, 0, N'ZWaveReportEvent', N'ZWave Report Event', NULL, NULL, NULL, 237)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1201, 0, N'ZWaveStatusEvent', N'ZWave Status Event', NULL, NULL, NULL, 238)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1202, 0, N'ZWaveDownloadScenarioEvent', N'ZWave Download Scenario Event', NULL, NULL, NULL, 239)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1203, 0, N'ZWaveNodeInformationEvent', N'ZWave Node Information Event', NULL, NULL, NULL, 240)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1204, 0, N'ZWaveMaintenanceEvent', N'ZWave Maintenance Event', NULL, NULL, NULL, 241)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1206, 0, N'ZWaveStatusReportEvent', N'ZWave Status Report Event', NULL, NULL, NULL, 242)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1250, 0, N'RuleStatusAdd', N'Rule Status Add', NULL, NULL, NULL, 243)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1251, 0, N'RuleStatusModify', N'Rule Status Modify', NULL, NULL, NULL, 244)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1252, 0, N'RuleStatusDelete', N'Rule Status Delete', NULL, NULL, NULL, 245)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1253, 0, N'RuleStatusExcute', N'Rule Status Excute', NULL, NULL, NULL, 246)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1254, 0, N'RuleStatusStop', N'Rule Status Stop', NULL, NULL, NULL, 247)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1255, 0, N'RuleStatusUpdateStatus', N'Rule Status Update Status', NULL, NULL, NULL, 248)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1256, 0, N'NotificationAlarmEvent', N'Rule Notification Event', NULL, NULL, 1, 249)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1257, 0, N'NotificationSmsMessageEvent', N'Rule Notification Event', NULL, NULL, 1, 250)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1258, 0, N'RuleExecutedEndPartialSuccessEvent', N'Rule Executed End Partial Success', NULL, NULL, NULL, 251)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1259, 0, N'RuleExecutedEndSuccessEvent', N'Rule Executed End Success', NULL, NULL, NULL, 252)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1260, 0, N'RuleExecutedFailEvent', N'Rule Executed FailEvent', NULL, NULL, NULL, 253)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1310, 0, N'HomeAutomationActivationRequest', N'Home Automation Activation Request', NULL, NULL, NULL, 254)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1400, 0, N'DeviceDiagnosticInformationEvent', N'Device Diagnostic Information Event', NULL, NULL, NULL, 255)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1401, 0, N'DeviceLogEvent', N'Device Log Event', NULL, NULL, NULL, 256)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1402, 0, N'DeviceDiagnosticsConfigurationEvent', N'Device Diagnostics Configuration Event', NULL, NULL, NULL, 257)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1500, 0, N'EncriptionKeyVerification', N'Encription Key Verification Event', NULL, NULL, NULL, 258)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1863, 0, N'NewFirmwareVersion', N'Panel transmitted its firmware version', NULL, NULL, NULL, 259)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1865, 0, N'RemoteBootLog', N'Remote boot log', NULL, NULL, NULL, 260)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1867, 0, N'DeviceNewFirmwareVersion', N'Panel transmitted a device firmware version', NULL, NULL, NULL, 261)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1868, 0, N'DeviceRfLevel', N'Device RF strength changed', NULL, NULL, NULL, 262)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1869, 0, N'DeviceTemperatureLevel', N'Device temperature changed', NULL, NULL, NULL, 263)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1870, 0, N'DeviceBatteryLevel', N'Device battery level changed', NULL, NULL, NULL, 264)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1871, 0, N'PanelBatteryLevel', N'Panel battery level changed', NULL, NULL, NULL, 265)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1872, 0, N'PanelCapabilitiesUpdate', N'Panel Capabilities Update', NULL, NULL, NULL, 266)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (1873, 0, N'EcopFactoryResetStatusEvent', N'Factory Reset Status', NULL, NULL, NULL, 267)

	INSERT [dbo].[CD_Event] ([Event_Code], [Protocol_Id], [Event_Name], [Description], [Parsed_Expression], [XML_Expression], [NotificationGroupId], [Id]) VALUES (10000, 0, N'KeepAlive', N'Keepalive', NULL, NULL, NULL, 268)
END

SET IDENTITY_INSERT [dbo].[CD_Event] OFF
	
	
if not exists(select 1 from [dbo].[CD_Command])
BEGIN
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (11, 0, N'Arm', N'Full Arm', 1, 1, N'11', NULL, N'Command.Arm.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&partition=0&isForced=0', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (12, 0, N'PartialArm', N'Partial Arm', 1, 1, N'12', NULL, N'Command.Arm.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&partition={PARTITION}&isForced=0', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (13, 0, N'PerimeterArm', N'Perimeter Arm', 1, 1, N'13', NULL, N'Command.Arm.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&partition=4&isForced=0', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (14, 0, N'Disarm', N'Disarm', 1, 1, N'14', NULL, N'Command.Disarm.Json?email={0}&password={1}&pinCode={2}&panelId={3}&phoneType={4}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (15, 0, N'ForceArm', N'Force Arm', 1, 1, N'15', NULL, N'Command.Arm.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&partition=0&isForced=1', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (17, 0, N'PartDisarm', N'Partial Disarm', 1, 1, N'17', NULL, N'Command.Disarm.Json?email={0}&password={1}&pinCode={2}&panelId={3}&phoneType={4}&partition={PARTITION}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (21, 0, N'Video', N'Send video alarm or Pre-alarm', 0, 1, N'21', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (22, 0, N'Video', N'Send video CPA request  (only Alarm situation of panel)', 0, 1, N'22', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (31, 0, N'BypassZone', N'Bypass zone', 1, 1, N'31', NULL, N'Command.BypassZone.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&deviceId={DEVICEID}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (32, 0, N'UnbypassZone', N'UnBypass zone', 1, 1, N'32', NULL, N'Command.UnbypassZone.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&deviceId={DEVICEID}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (33, 0, N'CallCMS', N'Notification LED', 1, 1, N'33', NULL, N'Command.CallCMS.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&CallStationLedStatus={CALLSTATIONLEDSTATUS}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (39, 0, N'RemotePstnDisconnect', N'Remote PSTN disconnect', 1, 1, N'39', NULL, N'Command.RemotePstnDisconnect.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&action={ACTION}&time={TIME}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (41, 0, N'SendPanelStatus', N'Report panel status information', 1, 1, N'41', NULL, N'Command.GetSystemStatus.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}', 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (51, 0, N'ActivateHomeAutomationDevice', N'Home Automation Device', 1, 1, N'51', NULL, N'Command.ActivateHomeAutomationDevice.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&deviceId={DEVICEID}&status={STATUS}&response={RESPONSE}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (52, 0, N'ChangeRFOutputDeviceStatus', N'Change status to RF/Output', 1, 1, N'52', NULL, N'Command.ChangeRFOutputDeviceStatus.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&deviceId={DEVICEID}&status={STATUS}&response={RESPONSE}', 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (53, 0, N'ActivateDoorLockDevice', N'Activate Door Lock', 1, 1, N'53', NULL, N'Command.ActivateDoorLockDevice.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&deviceId={DEVICEID}&status={STATUS}&response={RESPONSE}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (54, 0, N'QueryRFOutputDevice', N'The pane is told to send information of RF-Output device status ', 1, 1, N'54', NULL, N'Command.QueryRFOutputDevice.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&deviceId={DEVICEID}', 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (55, 0, N'QueryDoorLockDevice', N'The pane is told to send information of Door Lock ', 1, 1, N'55', NULL, N'Command.QueryDoorLockDevice.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&deviceId={DEVICEID}', 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (56, 0, N'StopSirens', N'Stop Sirens', 1, 1, N'56', NULL, N'Command.StopSirens.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (92, 0, N'ChangeToOperationalMode', N'Activate Operational Mode', 1, 1, N'92', NULL, N'Command.ChangeToOperationalMode.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&operativeCode={OPERATIVECODE}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (93, 0, N'TurnPerimetralFlash', N'Change perimetral flash', 1, 1, N'93', NULL, N'Command.TurnPerimetralFlash.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&deviceId={DEVICEID}&changeStatusType={CHANGESTATUSTYPE}', 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (94, 0, N'TurnPerimetralVoice', N'Change perimetral voice', 1, 1, N'94', NULL, N'Command.TurnPerimetralVoice.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&deviceId={DEVICEID}&changeStatusType={CHANGESTATUSTYPE}', 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (99, 0, N'ResetRPC', N'ResetRPC', 0, 0, N'99', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (101, 0, N'SendVideo', N'Send Video', 1, 0, N'V1', NULL, N'Command.SendVideo.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&filename={FILENAME}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (102, 0, N'RequestSecurityVideo', N'Request Security Video', 1, 0, N'V2', NULL, N'Command.RequestSecurityVideo.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&deviceId={DEVICEID}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (103, 0, N'RequestUserVideo', N'Request User Video', 1, 0, N'V3', NULL, N'Command.TakeVideo.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&cameraId={CAMERAID}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (200, 0, N'ResetSystem', N'Reset System', 1, 0, N'E4', NULL, N'Command.EverGuardResetSystem.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (300, 0, N'EntryInIPListening', N'Activate Listening Mode', 1, 1, N'E5', NULL, N'Command.EntryInIPListening.json?email={EMAIL}&password={PASSWORD}&pinCode={PINCODE}&panelId={PANELID}&phoneType={PHONETYPE}&listeningTime={LISTENINGTIME}&listeningProtocol={LISTENINGPROTOCOL}', 1)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5000, 1, N'AbortAddDevice', N'', 0, 1, N'77', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5001, 1, N'AddKeyFobDevice', N'', 0, 1, N'75', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5002, 1, N'AddRFInputDevice', N'', 0, 1, N'79', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5003, 1, N'AddSecurityDevice', N'', 0, 1, N'71', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5004, 1, N'AddSirenDevice', N'', 0, 1, N'AS', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5005, 1, N'AddTagDevice', N'', 0, 1, N'84', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5006, 1, N'Arm', N'', 0, 1, N'K1', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5007, 1, N'Boot', N'', 0, 1, N'BT', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5008, 1, N'Disarm', N'', 0, 1, N'K3', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5009, 1, N'EnableCommunityUsers', N'', 0, 1, N'C1', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5010, 1, N'EraseFlash', N'', 0, 1, N'EF', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5011, 1, N'ForceArm', N'', 0, 1, N'11', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5012, 1, N'GetReleaseVersion', N'', 0, 1, N'RV', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5013, 1, N'ModifySecurityDevice', N'', 0, 1, N'DP', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5014, 1, N'ModifyUser', N'', 0, 1, N'89', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5015, 1, N'PanelActivation', N'', 0, 1, N'W1', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5016, 1, N'PanelDeActivation', N'', 0, 1, N'W2', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5017, 1, N'Panic', N'', 0, 1, N'K4', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5018, 1, N'PartArm', N'', 0, 1, N'K2', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5019, 1, N'PutScriptFile', N'', 0, 1, N'PS', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5020, 1, N'Refresh', N'', 0, 1, N'R0', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5021, 1, N'RegisterUser', N'', 0, 1, N'73', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5022, 1, N'RemoveUser', N'', 0, 1, N'74', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5023, 1, N'SetPanelApn', N'', 0, 1, N'AP', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5024, 1, N'StartVideo', N'', 0, 1, N'VS', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5025, 1, N'StopSiren', N'', 0, 1, N'91', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5026, 1, N'StopVideo', N'', 0, 1, N'ST', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5027, 1, N'VerifyCRC', N'', 0, 1, N'VC', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5028, 1, N'WriteFrame', N'', 0, 1, N'WF', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5029, 1, N'AddSecurityDeviceWithDeviceType', N'', 0, 1, N'70', NULL, NULL, 0)
	
	INSERT [dbo].[CD_Command] ([Command_Code], [Protocol_Id], [Command_Name], [Description], [DataEnabled], [DTMFEnabled], [DTMFCommand], [Xsl_Parser], [Command_Template], [VisibileInClient]) VALUES (5030, 1, N'SetPanelConfigurations', N'', 0, 1, N'CU', NULL, NULL, 0)
END

if not exists(select 1 from [dbo].[CD_Communication_Channel])
BEGIN
	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (1, 1, N'SMS')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (1, 2, N'SMS')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (1, 3, N'SMS')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (1, 4, N'SMS')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (1, 5, N'SMS')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (1, 6, N'SMS')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (2, 1, N'GSM Data')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (2, 2, N'GSM Data')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (2, 3, N'GSM Data')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (2, 4, N'GSM Data')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (2, 5, N'GSM Data')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (2, 6, N'GSM Data')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (3, 1, N'PSTN')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (3, 2, N'PSTN')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (3, 3, N'PSTN')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (3, 4, N'PSTN')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (3, 5, N'PSTN')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (3, 6, N'PSTN')

	INSERT [dbo].[CD_Communication_Channel] ([Communication_Channel_Code], [Language_Code], [Communication_Channel_Desc]) VALUES (4, 1, N'GPRS')
END

if not exists (select 1 from [dbo].[CD_Device_Status_Load_Stages])
BEGIN
	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (0, 1, 1)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (0, 11, 2)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (0, 21, 5)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (0, 31, 3)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (0, 41, 4)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (1, 2, 1)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (1, 12, 2)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (1, 22, 5)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (1, 32, 3)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (1, 42, 4)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (4, 1, 1)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (4, 11, 2)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (4, 21, 5)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (4, 31, 3)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (4, 41, 4)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (5, 2, 1)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (5, 12, 2)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (5, 22, 5)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (5, 32, 3)

	INSERT [dbo].[CD_Device_Status_Load_Stages] ([Target_Device_Code], [Load_Status_Code], [Device_Load_Stage_Code]) VALUES (5, 42, 4)
END

if not exists(select 1 from [dbo].[CD_PSTN_Protocol])
BEGIN
	INSERT [dbo].[CD_PSTN_Protocol] ([PSTN_Protocol_Code], [PSTN_Protocol_Description]) VALUES (0, N'V.22')
	INSERT [dbo].[CD_PSTN_Protocol] ([PSTN_Protocol_Code], [PSTN_Protocol_Description]) VALUES (1, N'V.22F')
END	


if not exists(select 1  from [dbo].[CD_SIA])
BEGIN
	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'AR', N'Power Failure Restored', N'The control panel is reconnected to a fixed power supply')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'AT', N'Power Failure', N'The control panel is disconnected from a fixed power supply')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'BA', N'Burglary Alarm', N'Intrusion Detection')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'BB', N'Burglary Bypass', N'An intrusion detector has been deactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'BC', N'Burglary Alarm Cancellation', N'Intrusion alarm cancelled')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'BR', N'Burglary Alarm Restored', N'The state which caused the intrusion detection alarm changed (eg: door was closed)The state which caused the intrusion detection alarm changed (eg: door was closed)')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'BS', N'Intrusion Supervision Fault', N'A security device is malfunctioning and does NOT give protection to its zone')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'BU', N'Burglary Unbypass', N'An intrusion detector has been reactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'FA', N'Fire Alarm', N'Smoke detection alarm')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'FB', N'Fire Bypass', N'A smoke detector has been deactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'FC', N'Fire Alarm Cancellation', N'Fire alarm cancelled')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'FR', N'Fire Alarm Restored', N'The state which caused the smoke detection alarm has changed')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'FS', N'Fire Supervision Fault', N'A smoke detector is malfunctioning and does NOT give protection to its zone')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'FU', N'Fire Unbypass', N'A smoke detector has been reactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'GA', N'Gas Leakage Alarm', N'The state which caused the gas leakage alarm has changed')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'GB', N'Gas Bypass', N'A gas leakage detector has been deactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'GR', N'Gas Leakage Alarm Restored', N'The state which caused the gas leakage alarm has changed')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'GS', N'Gas Leakage Supervision Fault', N'A gas leakage detector is malfunctioning and does NOT give protection to its zone')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'GU', N'Gas Unbypass', N'A gas leakage detector has been reactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'HA', N'Duress Alarm', N'A duress/hold-out alarm (system disarmed under threat)')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'JA', N'User Code Tamper', N'Maximum wrong user codes have been entered')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'KA', N'Heat Alarm', N'Heat limit has been reached')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'KB', N'Heat Bypass', N'A heat detector has been deactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'KH', N'Heat Limit Restored', N'The state which caused the heat alarm has changed')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'KS', N'Heat Supervision Fault', N'A heat detector is malfunctioning and does NOT give protection to its zone')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'KU', N'Heat Unbypass', N'A heat detector has been reactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'LB', N'Local Programming', N'Started local programming of a control panel')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'LR', N'Phone Line Restore', N'Control panel''s phone communication has been restored')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'LT', N'Phone Line Trouble', N'Control panel''s phone line is down')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'LX', N'Local Programming Ended', N'Ended local programming of a control panel')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'NA', N'Inactivity Timeout', N'Device hasn''t reported a detection for a longer time period than allowed')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'OC', N'Alarm Cancellation', N'Alarm (other than intrusion or fire) has been cancelled')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'OR', N'Disarm in Alarm', N'Control panel was disarmed WHEN in alarm state')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'PA', N'Panic Alarm', N'User panic alarm (SOS)')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'PB', N'Panic Bypass', N'A panic device has been deactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'PU', N'Panic Unbypass', N'A panic device has been reactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'RB', N'Remote Programming', N'Started remote programming of a control panel')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'RP', N'Automatic Communication Test', N'Automatic test of the control panel''s communications')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'RS', N'Remote Programming Ended', N'Ended remote programming of a control panel')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'RX', N'Manual Communication Test', N'Manual test of the control panel''s communications')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'TA', N'Tamper Alarm', N'A device has been tampered with (eg: taken off the wall, opened, etc)')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'TR', N'Tamper Reset', N'The state which caused the tamper alarm changed (eg: the device''s door was closed)')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'UA', N'Other Alarm', N'An alarm occurred in an unknown type of device')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'UB', N'Other Bypass', N'An unknown type of device has been deactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'UH', N'Other Alarm Restored', N'An alarm from an unknown type of device has been restored')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'US', N'Other Device Supervision Fault', N'An unknown device is malfunctioning and does NOT give protection to its zone')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'UU', N'Other Unbypass', N'An unknown type of device has been reactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'WA', N'Flood Alarm', N'A flood was detected')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'WB', N'Flood Bypass', N'A flood detector has been deactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'WR', N'Flood Alarm Restored', N'The state which caused the water leakage alarm has changed')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'WS', N'Flood Supervision Fault', N'A water leakage detector is malfunctioning and does NOT give protection to its zone')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'WU', N'Flood Unbypass', N'A water leakage detector has been reactivated')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'XH', N'RF Interference Restored', N'The condition which caused the RF jamming alarm has changed')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'XQ', N'RF Interference', N'An RF interference has been detected (jamming alarm)')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'XR', N'Device restored from low battery state', N'Peripheral device''s battery is full')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'XT', N'Low Battery in Peripheral', N'Peripheral device''s battery is running low')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'YM', N'No Battery in Control Panel', N'Control panel''s battery is exhausted')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'YR', N'New Battery was Inserted INTO Control Panel', N'A new battery was inserted INTO the control panel')

	INSERT [dbo].[CD_SIA] ([SIA_Code], [SIA_Name], [SIA_Description]) VALUES (N'YT', N'Low Battery in Control Panel', N'Low battery inside the control panel')
END

if not exists(select 1 from [dbo].[CD_Video_GOP])
BEGIN
	INSERT [dbo].[CD_Video_GOP] ([Video_GOP_Code], [Frames_in_GOP]) VALUES (0, 5)

	INSERT [dbo].[CD_Video_GOP] ([Video_GOP_Code], [Frames_in_GOP]) VALUES (1, 10)

	INSERT [dbo].[CD_Video_GOP] ([Video_GOP_Code], [Frames_in_GOP]) VALUES (2, 15)

	INSERT [dbo].[CD_Video_GOP] ([Video_GOP_Code], [Frames_in_GOP]) VALUES (3, 20)

	INSERT [dbo].[CD_Video_GOP] ([Video_GOP_Code], [Frames_in_GOP]) VALUES (4, 30)

	INSERT [dbo].[CD_Video_GOP] ([Video_GOP_Code], [Frames_in_GOP]) VALUES (5, 45)

	INSERT [dbo].[CD_Video_GOP] ([Video_GOP_Code], [Frames_in_GOP]) VALUES (6, 60)

	INSERT [dbo].[CD_Video_GOP] ([Video_GOP_Code], [Frames_in_GOP]) VALUES (7, 255)
END

if not exists(select 1 from [dbo].[CD_Video_REG_RES])
BEGIN
	INSERT [dbo].[CD_Video_REG_RES] ([REG_RES], [REG_RES_Description]) VALUES (N'000', N'VGA (640x480)')

	INSERT [dbo].[CD_Video_REG_RES] ([REG_RES], [REG_RES_Description]) VALUES (N'001', N'QVGA (320x240) ')

	INSERT [dbo].[CD_Video_REG_RES] ([REG_RES], [REG_RES_Description]) VALUES (N'002', N'QQVGA (160x120) ')

	INSERT [dbo].[CD_Video_REG_RES] ([REG_RES], [REG_RES_Description]) VALUES (N'003', N'QQQVGA (80x60)')
END

if not exists(select 1 from [dbo].[CD_Video_Service])
BEGIN
	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'001', N'Video Alarm')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'002', N'Photo Alarm')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'010', N'Video Pre-Alarm')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'012', N'Photo Pre-Alarm')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'020', N'SD Operator Video Alarm Request')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'021', N'SD Operator Video Alarm Request All Units')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'022', N'SD Operator Photo Alarm Request')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'023', N'SD Operator Photo Alarm Request All Units')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'110', N'Video Suspicious')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'121', N'Video Open/Close')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'131', N'Video Employee Control')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'140', N'Video User Request')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'150', N'Video Tele-Surveillance')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'160', N'Event Triggered Video')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'210', N'Photo Suspicious')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'221', N'Photo Open/Close')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'231', N'Photo Employee Control')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'240', N'Photo User Request')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'250', N'Photo Tele-Surveillance')

	INSERT [dbo].[CD_Video_Service] ([Video_Service_Code], [Video_Service_Description]) VALUES (N'260', N'Event Triggered Photo')
END

if not exists(select 1 from [dbo].[CD_Video_Transmission_Type])
BEGIN
	INSERT [dbo].[CD_Video_Transmission_Type] ([Video_Transmission_Type_code], [Video_Transmission_Type_Description]) VALUES (N'000', N'GSM DATA')

	INSERT [dbo].[CD_Video_Transmission_Type] ([Video_Transmission_Type_code], [Video_Transmission_Type_Description]) VALUES (N'001', N'GPRS')

	INSERT [dbo].[CD_Video_Transmission_Type] ([Video_Transmission_Type_code], [Video_Transmission_Type_Description]) VALUES (N'002', N'IP NETWORK')

	INSERT [dbo].[CD_Video_Transmission_Type] ([Video_Transmission_Type_code], [Video_Transmission_Type_Description]) VALUES (N'003', N'PSTN')
END

if not exists(select 1 from [dbo].[CD_Video_VFR])
BEGIN
	INSERT [dbo].[CD_Video_VFR] ([REG_VFR], [REG_VFR_Description]) VALUES (N'000', N'Multi JPG')

	INSERT [dbo].[CD_Video_VFR] ([REG_VFR], [REG_VFR_Description]) VALUES (N'003', N'H.264 Video Elementary Stream')

	INSERT [dbo].[CD_Video_VFR] ([REG_VFR], [REG_VFR_Description]) VALUES (N'004', N'H.264 MP4')
END



