python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
difference between truncate delete and drop in SQL Server

difference between TRUNCATE, DELETE and DROP in SQL Server

DELETE Command

 1. DELETE is a DML command.
 2. DELETE is more slower than TRUNCATE command.
 3. DELETE maintain the logs before execute command. So its slower.
 4. In DELETE case, data rollback passable because it's maintain log file. 
 5. If we execute DELETE command that time tiger fired.
 6. In DELETE, we can use the WHERE clause.

      Example.  DELETE FROM AppLog WHERE LogId=1


  1.   TRUNCATE is a DDL command.
  2.   TRUNCATE is more faster than DELETE command.
  3.   TRUNCATE not maintain logs so it's faster.
  4.   In TRUNCATE  case, data rollback not passable because it's not maintain log file .
  5.   If we execute TRUNCATE command that time tiger not fired.
  6.   In TRUNCATE , we can't use the WHERE clause.
     Example. TRUNCATE TABLE AppLog

DROP  Command

  1. DROP  is a DDL command.
  2. In case of DROP  command, TABLE delete permanently that menace all the table's  rows, indexes and privileges will  be removed from database.

  Example. DROP TABLE AppLog


Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like Powered by Blogger.
ASK Questions