If a table is referenced by other table. We can’t truncate this table directly.
There are two ways to Truncate records from referenced table.
- Delete all records with delete command.
- Reset the table identity.
- Remove foreign key constraint.
- Truncate table.
- Apply foreign key constraint again.