sql tutorial

SQL TRUNCATE TABLE


  SQL > Table Manipulation > Truncate Table Statement

Sometimes we wish to get rid of all the data in a table. One way of doing this is with DROP TABLE, which we saw in the last section. But what if we wish to simply get rid of the data but not the table itself? For this, we can use the TRUNCATE TABLE command. The syntax for TRUNCATE TABLE is

TRUNCATE TABLE "table_name"

So, if we wanted to truncate the table called customer that we created in SQL CREATE TABLE, we simply type,

TRUNCATE TABLE customer

SQL INSERT >>





Copyright 1999-2008 1keydata.com.   All Rights Reserved.     Privacy Policy





SQL SELECT
SQL DISTINCT
SQL WHERE
SQL AND OR
SQL IN
SQL BETWEEN
SQL LIKE
SQL ORDER BY
SQL Functions
SQL COUNT
SQL GROUP BY
SQL HAVING
SQL ALIAS
SQL JOIN
SQL OUTER JOIN
SQL CONCATENATE
SQL SUBSTRING
SQL TRIM

SQL CREATE TABLE
SQL CONSTRAINT
SQL PRIMARY KEY
SQL FOREIGN KEY
SQL CREATE VIEW
SQL CREATE INDEX
SQL ALTER TABLE
SQL DROP TABLE
SQL TRUNCATE TABLE
SQL INSERT INTO
SQL UPDATE
SQL DELETE FROM

SQL Jobs




Site Map
Resources



Data Warehousing & Business Intelligence