Callback
  • From a market stall to a store

  • -

  • From a store to a retail chain

  • -

  • From retail to manufacturing

Deleting historical data in closed periods: procedure and consequences

Volodymyr Vytyshchenko
Volodymyr Vytyshchenko

Trade automation expert at Torgsoft

The Deletion of closed-period statistics function in the Torgsoft program is used to clean the database of outdated warehouse and financial documents from already closed periods. This reduces the database size and speeds up the program.

This material is intended for users and system administrators who have basic skills working with the operating system, Windows services, and Microsoft SQL Server. All described actions are performed at your own risk: incorrect changes to settings, services, or the database may lead to data loss or program failure. Before making any changes, it is recommended to create an up-to-date database backup, check available disk space, and make sure there are no active users in the system. If you are not confident in the correctness of your actions or in understanding the consequences — you should contact technical support.

When to perform the cleanup

  • The program has noticeably slowed down: products take longer to add, reports open slowly, and documents take longer to post.

  • The database size is approaching 10 GB — the limit for Microsoft SQL Server Express.

  • You need to hide detailed inventory turnover history for previous years from users.

  • Preparing the database for a new financial or reporting year.

How it shows up

  • Slow warehouse and checkout (cash desk) performance.

  • Delays when generating reports.

  • Errors or warnings about insufficient space in the database.

  • Inability to create new documents due to exceeding the database limit.

Why it happens

  • A large number of historical documents are stored in the database (invoices, receipts, stock movements).

  • SQL Server Express has a strict limit on the maximum database size.

  • There is no regular cleanup of outdated data.

How to run the procedure

  1. Make sure the periods you plan to clean are fully closed and no longer used in operations. Run the procedure only on the server PC, outside business hours, and with no active user connections.

  2. Create a full database backup.

  3. Run the «Deletion of closed-period statistics» function and select the calendar months to clean up, following the program help for the deletion steps. 

  4. After the operation, the program will:

    •   delete all financial and warehouse documents for the selected periods,

    •   automatically create goods receipt notes on the last day of each period to record closing balances,

    •   preserve the status of settlements via opening balances (debts),

    •   preserve summary data for the discount system and final cash balances.

How to verify the result

  • Compare stock balances, counterparty debts, and cash balances with the control values recorded before starting the procedure.

  • The acceptable discrepancy is no more than 1 unit.
    If discrepancies are larger — restore the database from the backup and contact technical support.

Risks and limitations

  • Loss of detail: you cannot view specific invoices and receipts in the deleted period.

  • Returns: returns for receipts from the deleted period are not possible using the standard method.

  • Gift certificates: certificates with a validity period “from the sale date” may stop working if they were sold in the deleted period.

  • Deletion lock: the period will not be deleted if it contains sales for which returns were processed in future periods.

  • Along with the statistics, records in the user action log and the document change log for that time are also cleared.

How to reduce risks in the future

  • Regularly monitor the database size.

  • Before closing periods, eliminate negative balances through inventory checks.

  • Keep a separate “historical” copy of the database (for example, OLD) to view old documents.

Final rule of use

If the database is growing, the program is slowing down, or you are approaching the SQL Server Express limit — deleting closed-period statistics is a procedure that helps solve these issues, speed up the program, and remove outdated documents.


Програма обліку товару | Торгсофт



Facebook Instagram YouTube Twitter Google News Apple Podcast SounCloud

Add comment

Add comment
Thank you for your feedback! It will be published after being reviewed by a moderator.
Related articles