Sunday, June 28, 2020

Differences Between Truncate, Drop and Delete


(Click here for You tube video link)




Here are the major differences between Truncate and Delete





Below are the major differences between Truncate and Delete






















Conclusion:

It highly recommended that, we fire a SELECT query with the same WHERE condition of DELETE to ensure how many rows are getting deleted.

Also, its a best practice to ensure that we run the DELETE command using Transaction and once we confirm that the no.of records impacted is fine, commit the transaction. Close the query window to ensure we complete the transaction, else the pending transaction would block all other transactions. If you close the window, it would ask you for the next action for the a pending transaction.


No comments:

Post a Comment

  Printing Number Pattern using SQL Link for video answer: SQL: --********************* --PRINT Pattern --********************* -- 1 -- ...