What is the difference between truncate and delete statement?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the different ways of moving data/databases between servers and databases in sql server? : Sql server database administration

512


1.what are diff types of joins , and explain diff between cross join and full outer join 2.diff types of views 3. Diff types of index 4. What is diff b/w stores procedure and function procedure 5.diff between double and int in SQL 6.diff between char and varchar in SQL. 7.Oracle or SQL whice you will preferred and why.

1097


Explain the benefits of user-defined functions?

530


Tell me what is the significance of null value and why should we avoid permitting null values?

552


What is sql profiler. What are the default templates with it? : sql server database administration

522






How to achieve Paging of records in SQL SERVER?

594


What is a print index?

501


How to configure odbc dsn with different port numbers?

561


Which are new data types introduced in sql server 2008?

605


Is there any difference between the primary key and unique key?

571


What are the advantages of using stored procedures in sql server?

512


What are the properties of the relational tables?

494


What is the difference between a function and a trigger?

575


can you instantiate a com object by using t-sql? : Sql server database administration

521


Define outer join?

538