Last active
August 29, 2015 14:20
-
-
Save roman-yagodin/130105a946a587c9bcf6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [Dotnetnuke7] | |
GO | |
/****** Object: StoredProcedure [dbo].[R7_DnnCleanup] Script Date: 07.05.2015 11:27:52 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
-- ============================================= | |
-- Author: Roman M. Yagodin | |
-- Create date: 07.05.2015 | |
-- Description: DNN Cleanup (after backup) | |
-- ============================================= | |
CREATE PROCEDURE [dbo].[R7_DnnCleanup] | |
AS | |
BEGIN | |
-- SET NOCOUNT ON added to prevent extra result sets from | |
-- interfering with SELECT statements. | |
SET NOCOUNT ON; | |
-- Clean TabUrls from deleted tabs | |
DELETE FROM dbo.TabUrls WHERE TabID NOT IN (SELECT TabID FROM dbo.Tabs); | |
-- Clean UrlTracking from deleted modules and null ones | |
DELETE FROM dbo.UrlTracking WHERE ModuleId IS NULL AND LastClick IS NULL; | |
DELETE FROM dbo.UrlTracking WHERE ModuleId NOT IN (SELECT ModuleId FROM dbo.Modules); | |
-- Clean EventLog & Shedule History | |
TRUNCATE TABLE EventLog; | |
TRUNCATE TABLE ScheduleHistory; | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment