What is actual difference between delete,drop,truncate ????? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

What is actual difference between delete,drop,truncate ?????

27th Sep 2016, 4:48 PM
Pooja
5 Answers
+ 2
Delete deletes a row of a table. Truncate deletes all rows of a table. Drop deletes all rows of a table and the table itself. By the way, how is that a C# question? Shouldn't you put a sql tag instead?
27th Sep 2016, 4:55 PM
Zen
Zen - avatar
0
What about the columns of the tables it won't get deleted ?
27th Sep 2016, 5:03 PM
Pooja
0
If you need to delete columns, then you should change schema with alter table commands, which are different between databases. And yes, change tag to sql.
27th Sep 2016, 8:49 PM
Ivan G
Ivan G - avatar
0
Delete : deletes the value Drop : delete table with structure and data. Truncate : makes the table empty.
27th Sep 2016, 8:54 PM
Jai Verma
Jai Verma - avatar
0
All theses operations r used in different situation. As required.
27th Sep 2016, 9:04 PM
Jai Verma
Jai Verma - avatar