Truncate Table

Truncating a table removes all rows, freeing up storage while retaining the table structure and definitions. Unlike a delete operation, it is typically faster and cannot be rolled back in many databases.

Select Database Connection

  • Open Database Explorer and choose the appropriate database connection.
  • From the list of available databases, select the one containing the table you wish to truncate.

Locate and Select the Table

  • In the database tables list, find the table you need to truncate.
  • Right-click on the table name and choose Truncate Table from the context menu.
Truncate table option
Access the Truncate Table option from the context menu

Confirm Truncation

  • A confirmation dialog will appear, asking if you’re sure you want to proceed. Click Yes to confirm or Cancel to abort.
Truncate confirmation dialog
Confirm that you want to remove all data from the table

Verify Success

  • After confirming, a success message will appear in the DB Code Panel at the bottom, indicating “Success, 0 rows affected,” which confirms the table has been truncated.
Success message after truncating
A confirmation message appears when the table is successfully truncated

This method allows you to quickly and safely truncate a table without manually entering SQL commands, reducing the chance of syntax errors.