Wiaanities Forum  
February 05, 2012, 03:08:27 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Send this topic  |  Print  
Author Topic: Difference between DELETE, TRUNCATE, DROP in SQL  (Read 1422 times)
Muthuganesh
Newbie
*
Posts: 9


Email
« on: November 24, 2008, 10:56:38 PM »
Reply with quoteQuote

Hi,

            Thought of sharing,

The DELETE command is used to remove rows from a table. A WHERE clause can be used only to remove some rows. If no WHERE condition is specified, all rows will be removed. After performing a DELETE operation you need to COMMIT or ROLLBACK the transaction to make the change permanent or to undo it.

TRUNCATE removes all rows from a table. The operation cannot be rolled back. As such, TRUCATE is faster and doesn't use as much undo space as a DELETE.

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.

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


M.Muthuganesh
Navagate

Logged
admin
Administrator
Jr. Member
*****
Posts: 52


Email
« Reply #1 on: November 24, 2008, 11:09:57 PM »
Reply with quoteQuote

Dear Ganesh,

I appreciate your voluteering to post articles, further please update an article on complete J2EE setup in our local network and softwares required and download links on the same

Pal
Logged
Pages: [1]
  Reply  |  Send this topic  |  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC