MSSQL -Part5: What is the difference between DELETE, DROP & TRUNCATE in SQL?

Опубликовано: 12 Февраль 2020
на канале: Codenbox AutomationLab
69
4

#sql #learnsql #mssql

▬▬▬▬▬▬ In this Video ▶️ ▬▬▬▬▬▬
The UPDATE statement is used to modify the existing records in a table.
Syntax:
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

The difference between DELETE, DROP & TRUNCATE in sql:
 The DROP command removes a table from the database.
 All the tables' rows, indexes and privileges will also be removed.
 The operation cannot be rolled back.
 DELETE operations can be rolled back (undone), while DROP and TRUNCATE operations cannot be rolled back
 We cannot use WHERE clause with TRUNCATE.
 To use Truncate on a table you need at least ALTER permission on the table.
 Truncate uses less transaction space than the Delete statement.
 Truncate cannot be used with indexed views.
 TRUNCATE is faster than DELETE.

▬▬▬▬▬▬ Useful Links 🛠 ▬▬▬▬▬▬
Blog ► http://codenboxautomationlab.com/​​​
GitHub Repo ► https://github.com/codenbox​​


▬▬▬▬▬▬ Connect with us 👋 ▬▬▬▬▬▬
~~~Subscribe to this channel, and press bell icon to get all updated videos on Selenium and Cypress Automation:    / codenboxautomationlab  

~~~ Follow us on Facebook & Twitter to get more updates:
►  / ​​​  
►  / codenboxteam