What is the difference between DELETE and TRUNCATE? - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Saturday, April 14, 2012

What is the difference between DELETE and TRUNCATE?

What is the difference between DELETE and TRUNCATE?

In TRUNCATE we can not rollback.. 
In DELETE we can rollback

More..

1) Delete keep the lock over each row where Truncate keps the lock on table not on all the row 

2) Counter of the Identity column is reset in Truncate where it is not reset in Delete. 

3) Trigger is not fired in Truncate where as trigger is fired in Delete.

No comments:

Post a Comment