ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

In a database, whats the difference between a delete statement and a truncate statement ?

user-image
تم إضافة السؤال من قبل MUHANNAD ABDULLAH ALI ABDULLAH , SENIOR INCIDENT MANAGER , JNCO
تاريخ النشر: 2017/02/11
مستخدم محذوف‎
من قبل مستخدم محذوف‎

Both DELETE and TRUNCATE commands are used to delete records from table. But

TRUNCATE is DDL command like DROP, whereas DELETE is a DML command. Therefore DELETE operations can be rolled back (undone), while DROP andTRUNCATE operations cannot be rolled back

Shekar Kola
من قبل Shekar Kola , Data & BI Specialist , Tec Evolution Technology Systems

Following are 2 main differences between Delete & Truncate statements1. Delete: keeps the track of identity columns, spaces used by table remains    Truncate: doesn't keep any spaces used by table, Identity begins from scratch Example: Identity column get the next record from the last generated  value even all the records DELETED, but if TRUNCATED identity starts from first available value from identity   2. Delete: maintains the records in Log    Truncate: deletes the records without maintaining log  

 

المزيد من الأسئلة المماثلة