TRUNCATE TABLE is a Data Definition Language operation in SQL that marks the extent of a table for deallocation. This operation removes all data from a table quickly, typically bypassing a number of integrity-enforcing mechanisms.
The syntax is the same in all the SQL products such as MySQL, PostgreSQL, SQL Server, etc.
Syntax:
TRUNCATE TABLE TableName
Example:
TRUNCATE TABLE tbEmployees;
The data from tbEmployees will be deleted in the preceding example, but the table definitions and integrity constraints associated with it will remain.
Please visit the index page to go through the SQL Server tutorial.
One comment