SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[forums_system_Import_Preperation]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[forums_system_Import_Preperation]
GO



CREATE  PROCEDURE [forums_system_Import_Preperation] 
AS
BEGIN
	-- used to prep the database before importing.

	
	BEGIN TRANSACTION
	/*
	DELETE FROM nntp_Posts WHERE ForumID = 10
	DELETE FROM forums_SearchBarrel WHERE ForumID = 10
	DELETE FROM forums_Posts WHERE ForumID = 10
	DELETE FROM forums_ThreadsRead WHERE ForumID = 10
	DELETE FROM forums_Threads WHERE ForumID = 10
	DELETE FROM forums_ForumPermissions WHERE ForumID = 10
	DELETE FROM forums_ForumPingBack WHERE ForumID = 10
	DELETE FROM forums_ForumsRead WHERE ForumID = 10
	DELETE FROM forums_PostAttachments WHERE ForumID = 10
	DELETE FROM forums_TrackedForums WHERE ForumID = 10
	DELETE FROM nntp_NewsGroups WHERE ForumID = 10
	DELETE FROM forums_ModerationAudit WHERE ForumID = 10
	DELETE FROM forums_Forums WHERE ForumID = 10
	DELETE FROM forums_ForumGroups WHERE ForumGroupID = 2
	*/

	DELETE FROM nntp_Posts WHERE ForumID > 4
	DELETE FROM forums_SearchBarrel WHERE ForumID > 4
	DELETE FROM forums_Posts WHERE ForumID > 4
	DELETE FROM forums_ThreadsRead WHERE ForumID > 4
	DELETE FROM forums_Threads WHERE ForumID > 4
	DELETE FROM forums_ForumPermissions WHERE ForumID > 4
	DELETE FROM forums_ForumPingBack WHERE ForumID > 4
	DELETE FROM forums_ForumsRead WHERE ForumID > 4
	DELETE FROM forums_PostAttachments WHERE ForumID > 4
	DELETE FROM forums_TrackedForums WHERE ForumID > 4
	DELETE FROM nntp_NewsGroups WHERE ForumID > 4
	DELETE FROM forums_ModerationAudit WHERE ForumID > 4
	DELETE FROM forums_Forums WHERE ForumID > 4
	DELETE FROM forums_ForumGroups WHERE ForumGroupID > 1

	COMMIT TRANSACTION
END

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

