What is the difference between truncate and delete statement?
Answers were Sorted based on User's Feedback
Answer / valarmathi
truncate delete all records from the table and it is auto
commit. We can't able to rollback the data after performing
truncate operation.
delete statement delete the specific or all records from
the table. But we can able to rollback the deleted record
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / rajiv singh
Truncate deletes all rows from table. But Delete deletes
row/rows by condition.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / sreejith s t
Both Truncate and delete deletes the rows from a table .
But we cant use where clause in truncate statement . While
doing delete operation all the deleted rows are logged in
the transaction log . It reduces the perfomance . In
truncate operation no transaction logging is happening .
Delete is Autocommited but Truncate is Not .
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / ismail hasan
truncate deletes records from a table and while truncating a
table, the table will be dropped from the database and will
again be created automatically. No where clause is
acceptable in truncate statement and one can't restore the
previous data (i.e no rollback is possible) into the table.
It's an efficient process.
Delete statement will delete a particular row(s) on your
choice.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / vasu
Both Truncate and delete deletes the rows from a table .
But we cant use where clause in truncate statement . While
doing delete operation all the deleted rows are logged in
the transaction log . It reduces the perfomance . In
truncate operation no transaction logging is happening .
Delete is Autocommited but Truncate is Not .
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / balaji t
Identity counter can be reset in truncate whereas it is not possible in delete.Truncate dont activate trigger whereas delete can be used in triggers.truncate is a DDL command whereas delete is a DML command.
| Is This Answer Correct ? | 0 Yes | 0 No |
Differentiate between SQL and ORACLE joins and write their syntax.
What are the common performance issues in sql server?
what is a live lock? : Sql server database administration
What are the different ways of moving data/databases between servers and databases in SQL Server?
How to delete duplicate rows in sql server?
How to retrieve range of 10th rows to 20 th rows from total rows from a database table.? (Not from Dataset)
10 Answers Cognizant, Infosys,
How to set the current database in ms sql server?
select the 3rd maximum salary from sql server database if 4 (just an example In practically I may not know the exact situation) of the highest salaries are equal.
Normalization and denormalization
What is the difference between Stored Procedure , Function and Package, 1. how many blocks in Package and what are they.
How many columns can exist together per table?
What are the different types of lock modes in sql server 2000?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)