Submit a ticketCall us

Looking to compare latest NPM features with previous versions of NPM?
The NPM new feature summary offers a comparison of new features and improvements offered with this release.

 

Home > Success Center > Web Help Desk (WHD) > Delete all tickets from the database to reset ticket numbering

Delete all tickets from the database to reset ticket numbering

Overview

This article describes how to reset the ticket numbering by deleting all tickets from the databse. Resetting ticket numbering in Web Help Desk (WHD), such as when you need to reset ticket numbering to start at 1, may require ticket deletion.

Note: Tticket deletion is required only if you want to move the ticket number backward If you want to increase the ticket number, you don't need to delete tickets.

Environment

All WHD versions

Steps

Warning: Perform a full database backup before deleting anything from the database. See Database Migration Options for information on backing up your WHD database. For PostgreSQL backup details, see Chapter 24. Backup and Restore in the PostgreSQL 9.2.6 Documentation. For SQL Server backup details, see Back Up and Restore of SQL Server Databases. For MySQL backup details, see Chapter 1. Backup and Recovery from MySQL Backup and Recovery documentation.​

Delete all rows from database tables

WARNING: This action cannot be undone. Verify that you have performed a full backup before deleting anything from the database.
 

Use the following SQL syntax:
DELETE from [table name];

The following are tables from which to delete rows *before* removing tickets:
Note: You must delete these database table rows *before* performing any further steps, so ignore the warning and remove all rows for each table.
TKT_APP_STEP_CLIENT_VOTE
TICKET_APPROVAL_STEP
TICKET_APPROVAL
TICKET_ATTACHMENT
TICKET_TAX_RATE
TICKET_STATUS_TIME
TICKET_CUSTOM_FIELD
TICKET_BULK_ACTION
EMAIL_DATA_OBJECT
HISTORY_ENTRY
TECH_NOTE
CLIENT_NOTE
JOB_TICKET_PART
JOB_TICKET_ASSET
LVL_ASSIGNMENT_HIST_ENTRY

 

Delete all tickets from database

Once you have cleared out the above tables, use the following SQL syntax for deleting tickets:

DELETE from JOB_TICKET;

Reset ticket numbering

Reset the ticket counter to the desired value, which is shown below as <starting><starting_number/></starting>. The counter can begin at any number you choose, using values going forwards or backwards. Use one of the following methods to reset ticket numbering:

FrontBase

Issue the following SQL:
Set UNIQUE=<starting_number><starting_number><starting/> for JOB_TICKET;

MySQL, SQL Server, OpenBase

  1. Edit the EO_PK_TABLE.
  2. Locate the row with NAME='JOB_TICKET';
  3. Set the PK value for this row to <starting_number><starting><starting_number/></starting></starting_number>.

PostgreSQL

Use the following SQL syntax:
ALTER SEQUENCE job_ticket_seq RESTART WITH<starting_number><starting_number><starting>;
Where <starting_number> is the ticket number starts from <starting/>.</starting_number></starting></starting_number>

Last modified
04:39, 23 Jun 2016

Tags

Classifications

Public