How to Truncate a Table in SQL Server

Last updated July 25, 2026 · By the SaturnSQL team

TRUNCATE TABLE removes every row by deallocating pages, far faster than DELETE, and resets the IDENTITY column to its seed. It fails if the table is referenced by any foreign key, even from an empty table.

TRUNCATE TABLE session_logs;

When a foreign key blocks TRUNCATE, fall back to DELETE FROM (slower, keeps the identity counter) and reseed manually with DBCC CHECKIDENT. Unlike in some databases, TRUNCATE in SQL Server can be rolled back inside an explicit transaction.

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Related SQL Server guides

© 2026 Panda Capital Oy Ab. All rights reserved.