top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

can any explain about SQL TRUNCATE TABLE?

+1 vote
398 views
can any explain about SQL TRUNCATE TABLE?
posted Nov 5, 2014 by Archana

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+2 votes

TRUNCATE is a DDL command. TRUNCATE operation cannot be rolled back and WHERE clause can’t be used with TRUNCATE. The TRUNCATE statement unconditionally removes all rows from a table. You cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint.

Systax:

TRUNCATE TABLE table-name

answer Nov 13, 2014 by Manikandan J
+1 vote

The SQL TRUNCATE TABLE command is used to delete complete data from an existing table.

You can also use DROP TABLE command to delete complete table but it would remove complete table structure form the database and you would need to re-create this table once again if you wish you store some data.
Syntax:

The basic syntax of TRUNCATE TABLE is as follows:

TRUNCATE TABLE table_name;

answer Nov 5, 2014 by Garun Kumar Mishra
...