Removing all rows from the Employee table

suggest change
TRUNCATE TABLE Employee;

TRUNCATE TABLE is often faster than DELETE FROM Employee, and it does not fire DELETE triggers. It still empties indexes; it does not leave them in place. DELETE removes rows. TRUNCATE deallocates data pages. There is no DELETE TABLE statement.

DELETE can remove selected rows. TRUNCATE always removes every row. After a DELETE of all rows, an identity counter usually continues from its previous value. TRUNCATE resets that counter on many systems, including SQL Server. Whether it resets is dialect-specific.

You cannot truncate a table that is the target of a foreign key. The table having its own foreign keys is a separate question and depends on the dialect.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents