What is the difference between truncate and delete statement?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the encryption mechanisms in sql server?

579


What is advantage data architect?

517


What is tablesample?

578


What is triggers and its types?

548


Explain a checkpoint?

538






What is the difference between ‘having’ clause and a ‘where’ clause?

555


Where cross join is used?

519


If we delete pack Spec what will be the status of pack Body ?

970


What is bcp? When does it use?

515


What is self join in sql server joins?

562


What are the differences between “row_number()”, “rank()” and “dense_rank()”?

543


You want to check the syntax of a complicated update sql statement without executing it. What command should you use?

492


Mention the 3 ways to get a count of the number of records in a table.

555


Explain temporary table vs table variable by using cursor alternative?

528


In case you have filters in your report, when filters will be applied in cached report instance?

81