Search
 
SCRIPT & CODE EXAMPLE
 

SQL

truncate statement in sql

/*truncate table syntax*/
/*table name is Employees*/
TRUNCATE TABLE Employees;
Comment

Truncate Table in SQL

TRUNCATE TABLE Customers;
Comment

what is truncate in sql

DELETE -
-DML COMMAND
-Delete Rows from the table one by one
-We can use where clause with Delete to delete single row
-Delete is slower than truncate
-ROLLBACK is possible with DELETE

DROP-
-DDL COMMAND
-Delete the entire structure or schema
-We can't use where clause with drop
-Drop is slower than DELETE & TRUNCATE
-ROLLBACK IS NOT POSSIBLE WITH DROP

TRUNCATE-
-DDL COMMAND
-Truncate deletes rows at a one goal
-We can't use where clause with Truncate
-Truncate faster than both DELETE & DROP
-Rollback is not possible with Truncate
Comment

truncate syntax in sql

+----+----------+-----+-----------+----------+
| ID | NAME     | AGE | ADDRESS   | SALARY   |
+----+----------+-----+-----------+----------+
|  1 | Ramesh   |  32 | Ahmedabad |  2000.00 |
|  2 | Khilan   |  25 | Delhi     |  1500.00 |
|  3 | kaushik  |  23 | Kota      |  2000.00 |
|  4 | Chaitali |  25 | Mumbai    |  6500.00 |
|  5 | Hardik   |  27 | Bhopal    |  8500.00 |
|  6 | Komal    |  22 | MP        |  4500.00 |
|  7 | Muffy    |  24 | Indore    | 10000.00 |
+----+----------+-----+-----------+----------+
Comment

PREVIOUS NEXT
Code Example
Sql :: login failed for login due to trigger execution 
Sql :: oracle create tablespace autoextend 
Sql :: using SQL in rails migration 
Sql :: oracle sql average 
Sql :: pgadmin see indexes 
Sql :: sql update 
Sql :: oracle select json_table example 
Sql :: select odd records sql 
Sql :: alter column to not null with default value sql server 
Sql :: postgresql newline character 
Sql :: create a PostgreSQL user django on mac 
Sql :: how to check which sp is running in sql server 
Sql :: mysql group concat 
Sql :: creating a view in sql 
Sql :: sql compiler online 
Sql :: create table with float datatype in sql server 
Sql :: sql pivot 
Sql :: sql pivot without aggregate 
Sql :: flask connect to mysql 
Sql :: mysql switch case 
Sql :: mysql unique constraint 
Sql :: how to execute MySQL Stored Procedure in Python 
Sql :: double in sql server example 
Sql :: DELETE DUPLICATE VALUES FROM A TABLE IN SQL SERVER 
Sql :: partition-by 
Sql :: having clause in sql 
Sql :: connect by query in oracle 
Sql :: postgresql find blocked query 
Sql :: what is delete in sql 
Sql :: tsql find procedure with name 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =