Each ticket in the Lansweeper helpdesk has a numeric ID, listed next to the ticket title. If you're testing the helpdesk, you may at one point want to delete all of your test tickets and start over. If you do, you may notice that IDs previously assigned to other tickets are not reused. You can manually reset the ticket ID counter to a specific number, so new tickets start counting from that point onward. The exact procedure you should follow depends on whether your database is hosted in the Microsoft SQL LocalDB, Microsoft SQL Server or deprecated Microsoft SQL Compact database server. You can verify which database server you are using with the ConfigEditor tool or in the Lansweeper web console. ![procedure-checking-database-server.jpg procedure-checking-database-server.jpg](https://community.lansweeper.com/t5/image/serverpage/image-id/819i5D5FA19E97DB6F21/image-size/large?v=v2&px=999)
Reset the ticket ID counter if you are using SQL Compact
- To be safe, back up your database first by following these instructions.
- Delete any tickets you no longer need as explained in this article.
- If you are keeping some of your tickets, run the report below in the Lansweeper web console to determine what the highest remaining ticket ID in your Lansweeper database is. You can add this report to your installation by following these instructions. Determining the highest remaining ticket ID is important so you know what you can reset the ticket ID counter to later on.
Select Max(htblticket.ticketid) As [Highest Ticket ID] From htblticket
- Run the DatabaseMaintenance tool on your Lansweeper server, found at
Program Files (x86)\Lansweeper\Tools\DatabaseMaintenance.exe
. ![menu-databasemaintenance.jpg menu-databasemaintenance.jpg](https://community.lansweeper.com/t5/image/serverpage/image-id/822i16F9F6B91EBDA5B9/image-size/large?v=v2&px=999)
- Replace "1000" in the script below with the ticket ID you want to start counting from, copy and paste the code into the Script Execution tab of the tool and select Execute.
ALTER TABLE htblticket ALTER COLUMN ticketid IDENTITY (1000, 1)
If there are still tickets in your database, the ticket ID you submit in the script should be higher than the highest ticket ID currently in your database. Otherwise, the database will try to reuse existing IDs and generate errors, e.g. "ticket does not exist" or "duplicate value cannot be inserted into a unique index."
- Restart your web server service in Windows Services. Keep in mind that this will log everyone out of the console. Your web server service is either IIS Express or World Wide Web Publishing Service (IIS).
![procedure-restarting-the-web-server-service.jpg procedure-restarting-the-web-server-service.jpg](https://community.lansweeper.com/t5/image/serverpage/image-id/1309iD2FB2B722AF01D3A/image-size/large?v=v2&px=999)
Reset the ticket ID counter if you are using SQL LocalDB or SQL Server
- To be safe, back up your database first by following these instructions.
- Delete any tickets you no longer as explained in this article.
- If you are keeping some of your tickets, run the report below in the Lansweeper web console to determine what the highest remaining ticket ID in your Lansweeper database is. You can add this report to your installation by following these instructions. Determining the highest remaining ticket ID is important so you know what you can reset the ticket ID counter to later on.
Select Max(htblticket.ticketid) As [Highest Ticket ID] From htblticket
- Run the DatabaseMaintenance tool on your Lansweeper server, found at
Program Files (x86)\Lansweeper\Tools\DatabaseMaintenance.exe
.![menu-databasemaintenance.jpg menu-databasemaintenance.jpg](https://community.lansweeper.com/t5/image/serverpage/image-id/822i16F9F6B91EBDA5B9/image-size/large?v=v2&px=999)
- Replace "1000" in the script below with the ticket ID you want to start counting from, copy and paste the code into the Script Execution tab of the tool and select Execute.
DBCC CHECKIDENT (htblticket, RESEED, 1000)
If there are still tickets in your database, the ticket ID you submit in the script should be higher than the highest ticket ID currently in your database. Otherwise, the database will try to reuse existing IDs and generate errors, e.g., "ticket does not exist" or "duplicate value cannot be inserted into a unique index."
- Restart your web server service in Windows Services. Keep in mind that this will log everyone out of the console. Your web server service is either IIS Express or World Wide Web Publishing Service (IIS).
![procedure-restarting-the-web-server-service.jpg procedure-restarting-the-web-server-service.jpg](https://community.lansweeper.com/t5/image/serverpage/image-id/1309iD2FB2B722AF01D3A/image-size/large?v=v2&px=999)