what is difference between delete and truncet ?
Answer Posted / nitin bisht
Delete : A delete statement deletes the data from a table. A
delete statement can have a where clause, on which it
deletes the records that satisfy only the “where” condition.
If the
“where” condition is omitted the delete statement deletes
all the records in a table.
Actions of Delete statement :
* deletes the data from the current table space
* Modifies the undo tablespace with the delete records.
* Executes all the before / after statement and row
level triggers.
* Updates the indexes (makes the index empty if the
where clause is omitted).
* Constraint checks are performed before deleting the rows
.
Syntax of a delete Statement:
DELETE FROM table [WHERE condition]
Truncate : Truncate drops all the records in a table . But
as it is a DDL statement data cannot be retrieved. Usually
truncate is faster than delete statement becuase there is no
need to change or update the UNDO tablespace with the
deleted records. Truncate is an implict commit
Statement.Truncate statement deallocates the space.
Actions of Truncate Statement:Removes all the records from
the current tablespace.
* Updates the indexes.
* High watermark of the truncated table is reset.
* Integrity Constraint checks are performed
Syntax of a Truncate Statement:
TRUNCATE TABLE table_NAME ;
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
First input columns brand, mt, re values are ov, 1,re vg, 2,re wu ,3,re. Second input columns are brand, mt, cx their records are ov,4,vg ,5,cx Wu, 6,cx and third input columns brand, mt, rt values are ov,7,rt vg, 8,rt wu, 9,rt but my output is brand, re, cx,rt values are ov, 1,4,7 vg, 2,5,8 wu, 3,6,9
where can i free download sqlserver2008..i can install sqlserver2008 without visual studio 2008 and work on it
How many indexes can be created on a table?
Is hive a database?
What is a reference table in database?
What is ole db source in ssis?
How default key is different from primary key?
query to Compare data of two tables between two different Databases(Oracle and SQL Server) Eg., Source Database: Oracle Table: Employee Target Database : SQL Server Table : emp
WHAT IS THE PURPOSE OF TESTING INTEGRITY OF THE UNIVERSE?
What is the Difference Primary key and Unique Key
What is meant by distributed system?
What is aws documentdb?
What are indexes in oracle?
After normalization, what are the conditions which have to keep in mind to de-normalize it?
How to implement database security?