-- Drop MBSAAlertRule table
ALTER TABLE [MBSAAlertRule] DROP CONSTRAINT [FK_MBSAAlertRule_AlertRule]
GO

DROP TABLE [MBSAAlertRule]
GO

-- Clean MBSA Alert data
DELETE FROM [Alert] WHERE [AlertID] IN (SELECT AlertID FROM [AlertRule] WHERE AlertTypeID = 8)

GO
DELETE FROM [AlertAttributeType] WHERE [AlertTypeID] = 8
GO
DELETE FROM [AlertType] WHERE [AlertTypeID] = 8
GO

-- Clean MBSA Monitor data
DELETE FROM [MonitorType] WHERE [MonitorTypeID] = 8
GO

DELETE FROM [Monitor] WHERE [MonitorType] = 8
GO

-- Update MwusConfiguration table
UPDATE [MwusConfiguration]
SET [Value] = 'http://download.mw-rmm.barracudamsp.com'
WHERE [Key] = 'InitialMetadataHttpServer'
GO

-- The below key will be recreated on MWExpertSystem start with a new value containing the TenantGuid and the Site Guid.
DELETE FROM [MwusConfiguration] WHERE [Key] = 'DssService_ServerAccountName'
GO