Purging Jobs

Permanently delete and remove multiple jobs from your database

Purging jobs from HelpMaster means the complete and permanent deletion of all job data for a defined set of job(s). System and database administrators may wish to use this process to clean out old data, or simply use it to trim down the size of the HelpMaster database.

This function only removes jobs from the HelpMaster database.

It does not remove any other entities, or configuration - even if they are linked to the jobs being removed/purged. All clients, sites, assets, templates, workflow etc will remain intact. Only jobs are removed.

The basic principle behind purging jobs is to use the Job Finder to find and select the jobs that you wish to remove, and then once you have confirmed your selection, the jobs will be permanently removed from your HelpMaster database.

Use

  1. Open the Purge Jobs screen via the Administration menu > Purge Jobs
  2. Click Next to skip the first screen of the wizard
  3. Click Add to display the Job Finder

Purge Wizard Add

  1. Use the Job Finder as normal to find all of the jobs that you wish to purge

Purge Wizard Job Finder

  1. Click Find Now on the Job Finder to return the results back to the Purge Wizard list
    • The View button on the Purge Jobs screen will display any selected job so as confirm whether it should be purged or removed from the list
    • The Add button will display the Job Finder screen again.Use this to change the base list of jobs to be purged
    • The Remove button will remove whatever jobs are selected from the list of jobs to be purged. The Remove button does not purge the jobs
  2. When you are sure that the list only contains jobs that you wish to purge, click Next >

Purge Wizard Job Finder

  1. Select which purge options you wish to use
    • Purge all selected Jobs including those marked with the Don’t purge setting - Careful using this option as it will override the Don’t purge selection on the properties tab of jobs. Select only if you are certain that you want to purge ALL listed jobs
    • Promote the child Jobs to become standard Jobs - This will promote the child jobs of any listed jobs and exclude them from being purged
    • Purge the child Jobs also - This will purge all child jobs linked to listed parent jobs
  2. Click the Purge Selected Jobs button to permanently delete the jobs in the list (plus any child jobs if the Purge the child Jobs also option is selected)

Purge Wizard Options

Depending on how many jobs have been selected, purging the data may take some time.

Use SQL Server Directly to purge / delete jobs

An alternative way to purge jobs is to use SQL Server directly and execute the purge job stored procedure via direct SQL. This option is preferable when performing large-scale delete operations, or when you have complex filtering requirements. The idea here is to provide a SQL statement that selects all of the jobs that you wish to permanently remove. The SQL statement can be anything that selects these jobs, and the only field it returns must be the PKID (job number).

The example below finds the jobs based on the date they were logged, and are closed.

Copy and paste the following statement into a new query window in SQL Server Management Studio. Ensure that you’ve selected the HelpMaster database. Adjust the filtering where clause to suit the date range and execute the query to permanently delete the jobs.

DECLARE	@return_value int

EXEC	@return_value = [dbo].[stpDeleteJobsAndAllLinksInPKIDList]
		@JobPKIDs = N'Select PKID From tblHelpdeskJobs Where DateLogged Between ''01/01/2000'' AND ''12/31/2000'' AND DateClosed Is Not NULL',
		@PurgeChildJobs = 1,
		@SkipDontPurgeJobs = 1

SELECT	'Return Value' = @return_value

See Also

Don’t purge setting on individual jobs

The Job finder

Database Maintenance

Database growth