In SQL Server, we can use TRUNCATE statement to clear all the records in a table and it usually performs better compared with DELETE statements as no transaction log for each individual row deletion.

The syntax looks like the following:

TRUNCATE TABLE { database_name.schema_name.table_name | schema_name.table_name | table_name }  
[;]  

Equivalent in Teradata

Unfortunately Teradata doesn't provide TRUNCATE TABLE statement. The similar statement is:

 DELETE TABLENAME ALL;
warning In previous Teradata version, there is performance differences between DELETE and DELETE ALL; however they are not equivalents and there is no performance differences according to Andrew Livingston from Teradata!

Code snippet

DELETE MYTDDB.MYTABLE ALL;


copyright This page is subject to Site terms.

More from Kontext

local_offer teradata local_offer SQL

visibility 9
thumb_up 0
access_time 11 days ago

The following code snippets show how to use round numbers to hundreds or thousands in Teradata.  warning Alert - The following code snippets are used to round to the smallest hundreds or thousands that is equal or greater than the i...

open_in_new Code snippets

local_offer teradata local_offer SQL

visibility 18
thumb_up 0
access_time 11 days ago

In article   Teradata SQL...

open_in_new Code snippets

local_offer teradata local_offer SQL

visibility 11
thumb_up 0
access_time 11 days ago

This page shows you how to use LIKE

open_in_new Code snippets

local_offer teradata local_offer SQL

visibility 10
thumb_up 0
access_time 11 days ago

This page shows how to trim or remove leading or/and trailing zeros using Teradata SQL.

open_in_new Code snippets

comment Comments (0)

comment Add comment

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

No comments yet.

Kontext Column

Created for everyone to publish data, programming and cloud related articles. Follow three steps to create your columns.


Learn more arrow_forward