DECLARE @TaskName VARCHAR(50) = 'Suggested Count Export'

IF EXISTS (SELECT * FROM tbTaskname WHERE taskname = @TaskName)
BEGIN
	DECLARE @taskId INT
	DECLARE @xsltManagerId INT
	
	
	SELECT @taskId = TaskNameId FROM dbo.tbTaskName WHERE TaskName= @TaskName
	
	DELETE FROM tbTaskXsltExportDetail WHERE TaskNameId = @taskId 
	DELETE FROM tbTaskXsltExportZone WHERE TaskNameId = @taskId
	DELETE FROM tbTaskXsltExport WHERE TaskNameId = @taskId
	DELETE FROM  tbTaskName WHERE TaskNameId = @taskId
	;
END


DECLARE @ScriptName varchar (250) = '211124-CWG-2.sql'
		EXEC [dbo].[Rollback_RemoveDeployHistory] @ScriptName
GO