﻿IF EXISTS (SELECT 1 FROM sys.services WHERE name = 'AuditServiceTarget') BEGIN
  DROP SERVICE AuditServiceTarget
END
GO

IF EXISTS (SELECT 1 FROM sys.services WHERE name = 'AuditServiceInit') BEGIN
  DROP SERVICE AuditServiceInit
END
GO


IF EXISTS (SELECT 1 FROM sys.services WHERE name = 'AuditService') BEGIN
  DROP SERVICE [AuditService]
END
GO

IF EXISTS (SELECT 1 FROM sys.service_queues WHERE name = 'AuditQueue') BEGIN
  DROP QUEUE auditlog.AuditQueue
END
GO

IF EXISTS (SELECT 1 FROM sys.service_contracts WHERE name = 'AuditContract') BEGIN
  DROP CONTRACT AuditContract
END
GO

IF EXISTS (SELECT 1 FROM sys.service_message_types WHERE name = 'AuditMessage') BEGIN
  DROP MESSAGE TYPE AuditMessage 
END
GO


