Kontext Copilot - An AI-powered assistant for data analytics that runs on your local computer. Learn more
Get started
Truncate table in Teradata
insights Stats
warning Please login first to view stats information.
Raymond
Code Snippets & Tips
Code snippets and tips for various programming languages/frameworks. All code examples are under MIT or Apache 2.0 license unless specified otherwise.
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.
comment Comments
No comments yet.