Submit a ticketCall us

Don’t fall victim to a ransomware attack
Backups are helpful, but sometimes that’s not enough to protect your business against ransomware. At our live webcast we will discuss how to protect against ransomware attacks with SolarWinds® Patch Manager and how to leverage log data to detect ransomware. Register now for our live webcast.

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.

Deleting the ticket is required only if you want to move the ticket number backwards. If you want to increase the ticket number, deleting the ticket is not required. 

Environment

All WHD versions

Steps

Warning: Perform a full database backup before you delete 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

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.

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 the database

After you clear out the tables listed above, use the following SQL syntax for deleting tickets:

DELETE from JOB_TICKET;

Reset the 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
10:15, 31 May 2017

Tags

Classifications

Public