what is the difference between drop,truncate and delete commands?explain me with examples?
Printable View
what is the difference between drop,truncate and delete commands?explain me with examples?
[B][U]Truncate [/U][/B]
this command will removes the data from the table
for ex
if u have a table with data if u give
truncate table-name;
command it removes the record Permanently
[B][U]Delete[/U][/B]
this command is same as truncate but Retrieves the data when we give rollback
[B][U]
Drop[/U][/B]
this removes both data and struture of the table Permanently
DROP:- It removed the table from the database along with its data.
TRUNCATE:-It deletes all the records from the table and dealocates all the resources . Data deleted by truncate can't be rolled back.
DELETE:-It deletes the records from the table which can be rolled back .