what is difference between delete and truncet ?
Answer Posted / shivaleela
DELETE:-
1.it is a DML stmt
2.it can include WHERE condition
3.it is only delete, so it can be rolled back can be ROLL
BACK
TRUNCATE:-
1.it is a DDL stmt
2.it can not include WHERE cnd
3.it is delete+commit ,so we cant roll back can not be ROLL
BACK
Both commands accomplish identical tasks (removing all data
from a table), but TRUNCATE is much faster
Reason:When you type DELETE.all the data get copied into
the Rollback Tablespace first.then delete operation get
performed.Thatswhy when you type ROLLBACK after deleting a
table ,you can get back the data(The system get it for you
from the Rollback Tablespace).All this process take
time.But when you type TRUNCATE,it removes data directly
without copying it into the Rollback Tablespace.Thatswhy
TRUNCATE is faster.Once you Truncate you cann't get back
the data.
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
What is the difference between database and server?
what is the full procedure for using store procedure in informatica7.1?
Define stored procedure?
i have windows-xp processor with P4 system. whenever I tried to download foxpro for windows 2.6 on windows XP, my operating system failed to install foxpro for windows 2.6.please. how could i download , install & run foxpro for windows 2.6 easily on windows XP ?
HOW PASS PARAMETERS FOLLOWING ORDER RPG-CL-RPG?
What the various ways to tune a teradata query
can i use the commands "modify" and Change in DB2 to alter my column datatype and its name in a table?
What are different types of joins used in?
Source File: Target EMPNO, SAL Empno, Format 101, 1000 101, 1000 101, 1100 101, 1000, 1100 101, 1000 101, 1000, 1100, 1000 101, 10000 101, 1000, 1100, 1000, 10000 102, 1100 102, 1100 102, 1300 102, 1100, 1300 102, 1200 102, 1100, 1300, 1200 102, 1500 102, 1100, 1300, 1200, 1500 How can i get that output using datastage(ETL) tool
On startup, the transaction log of a database has filled and recovery has suspended, what can I do?
How to do Data integrity testing? Who does this testing (Developer or tester)?
Given a table of Player which contains Sno and player name, write a query which finds all possible Table Tennis doubles pairings.
How much does it cost to build a database?
HOW WE PASS PARM PARAMETERS TO CL VARIABLES FROM RPGLE?
if i want to display the name of students such that to which city they belong must have count greaer than two