What is the difference between truncate and delete statement?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what role entity and relationship play in an ER diagram.

580


What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?

495


How to create an multi-statement table-valued function?

532


Can a table be created inside a trigger?

568


What are the five characteristics of good data?

520






What is the purpose of grouping data in a report?

547


What options are available to audit login activity? : sql server security

639


where the connection string store in the database

1532


Why do we use functions?

516


What is tempdb database? : SQL Server Architecture

609


Is the primary key column of a table an index in ms sql server?

543


How to set database to be single_user in ms sql server?

571


What are the different types of sub-queries?

600


How to use old values to define new values in update statements in ms sql server?

686


How to generate create view script on an existing view?

566