In most of the popular RDBMS like SQL Server, Oracle, MySQL, etc we use truncate table statement to delete all the records from an existing table. The difference between the DELETE TABLE and the TRUNCATE TABLE is that here in the case of the TRUNCATE TABLE no transactional log is maintained for each deleted row. Hence, TRUNCATE TABLE is faster as compared to the DELETE TABLE statement.
Unfortunately, there is no TRUNCATE
command in Teradata. Alternatively, you can use the DELETE ALL
statement.
Syntax
Below is the syntax for deleting all the rows of an existing table in Teradata.
DELETE database_name.tbl_name ALL;
Example
The following statement deletes all the records from the employee table in the Teradatapoint database.
DELETE Teradatapoint.employee ALL;