/*
alter table [WindowsEventNT6Monitor]
add
	--constraint WindowsEventNT6Monitor_Monitor_FK foreign key (MonitoringRuleID) references dbo.Monitor(MonitorID)
*/

alter table WindowsEventNT6MonitorSource
add
	constraint WindowsEventNT6MonitorSource_WindowsEventMonitor_FK foreign key (WindowsEventNT6MonitorID) 
		references WindowsEventNT6Monitor(WindowsEventNT6MonitorID) 
			on delete cascade
go


alter table WindowsEventNT6MonitorLevel
add
	constraint WindowsEventNT6MonitorSeverity_WindowsEventMonitor_FK foreign key (WindowsEventNT6MonitorID) 
		references WindowsEventNT6Monitor(WindowsEventNT6MonitorID) 
			on delete cascade
go

alter table [WindowsEventNT6AlertRule]
add
	constraint WindowsEventNT6AlertRule_AlertRule_FK foreign key (AlertRuleID) 
		references AlertRule(AlertRuleID) 
			on delete cascade
go

alter table [WindowsEventNT6Alert]
add
	constraint WindowsEventNT6Alert_WindowsEventNT6AlertRule_FK foreign key (AlertRuleID) 
		references [WindowsEventNT6AlertRule](AlertRuleID) 
			on delete cascade
go

alter table [WindowsEventNT6Alert]
add
	constraint WindowsEventNT6Alert_Device_FK foreign key (DeviceID) 
		references Device(DeviceID) 
			on delete cascade
go

