/* * Red Gate * * * _____ _ __ __ _____ _ _ _ * | __ \ | | | \/ | | __ \ | | | | | | * | | | || | | \ / | | | | | __ _ ___ | |__ | |__ ___ __ _ _ __ __| | * | | | || | | |\/| | | | | | / _` |/ __|| '_ \ | '_ \ / _ \ / _` || '__|/ _` | * | |__| || |____ | | | | | |__| || (_| |\__ \| | | || |_) || (_) || (_| || | | (_| | * |_____/ |______||_| |_| |_____/ \__,_||___/|_| |_||_.__/ \___/ \__,_||_| \__,_| * * * * * This script will drop all the database objects created to support the DLM Dashboard. * * For information about these objects, see: http://www.red-gate.com/dlm-dashboard/ddl-trigger * * If you have any problems, we really want to know. Please email us at: dbdashboardsupport@red-gate.com * * Copyright © Red Gate Software Ltd. 2015 | Version 1.2 | 20/Feb/2015 */ BEGIN TRANSACTION RG_SQLLighthouse_Uninstall /* Drop the stored procedures first, so none of the other objects can read or write to the tables we're about to delete*/ USE master; go IF OBJECT_ID(N'dbo.RG_SQLLighthouse_WriteEvent', N'P') IS NOT NULL DROP PROCEDURE dbo.RG_SQLLighthouse_WriteEvent; IF OBJECT_ID(N'dbo.RG_SQLLighthouse_ReadEvents', N'P') IS NOT NULL DROP PROCEDURE dbo.RG_SQLLighthouse_ReadEvents; IF OBJECT_ID(N'dbo.RG_SQLLighthouse_WriteError', N'P') IS NOT NULL DROP PROCEDURE dbo.RG_SQLLighthouse_WriteError; /* Now drop RedGate.SQLLighthouse tables, and the schema */ IF DB_ID(N'RedGate') IS NOT NULL BEGIN IF OBJECT_ID(N'RedGate.SQLLighthouse.DDL_Events', N'U') IS NOT NULL DROP TABLE [RedGate].[SQLLighthouse].[DDL_Events] IF OBJECT_ID(N'RedGate.SQLLighthouse.Trigger_Errors', N'U') IS NOT NULL DROP TABLE [RedGate].[SQLLighthouse].[Trigger_Errors] EXEC('USE RedGate; IF SCHEMA_ID(N''SQLLighthouse'') IS NOT NULL DROP SCHEMA SQLLighthouse') END /* Drop the trigger */ IF EXISTS (SELECT 1 FROM sys.server_triggers WHERE name = 'RG_SQLLighthouse_DDLTrigger') DROP TRIGGER [RG_SQLLighthouse_DDLTrigger] ON ALL SERVER GO COMMIT TRANSACTION RG_SQLLighthouse_Uninstall