Difference between TRUNCATE and DELETE commands

Difference between TRUNCATE and DELETE commands

hii,

What is the difference between TRUNCATE and DELETE commands?

View Answers

October 28, 2010 at 4:08 PM

hello,

  1. TRUNCATE is a DDL command whereas DELETE is a DML command.

  2. TRUNCATE is much faster than DELETE.


October 21, 2011 at 8:29 AM

truncate and delete both are used to delete data from SQL but the way they work is entirely different and quite important to understand to avoid crashing your database especially if you are working with a large data with huge data. when you delete data using delete command in SQL every row operation is logged and if you going to delete too much data your log segment may blew up, while with truncate its not the case. See here for more differences









Related Tutorials/Questions & Answers:
Difference between TRUNCATE and DELETE commands
Difference between TRUNCATE and DELETE commands  hii, What is the difference between TRUNCATE and DELETE commands?   hello,ADS_TO_REPLACE_1 TRUNCATE is a DDL command whereas DELETE is a DML command. TRUNCATE is much
What is difference between TRUNCATE & DELETE
What is difference between TRUNCATE & DELETE   What is difference between TRUNCATE & DELETE?   Hi, The DELETE command is used... a DELETE operation you need to COMMIT or ROLLBACK the transaction to make the change
Advertisements
Difference between DispatchAction and LookupDispatchAction
Difference between DispatchAction and LookupDispatchAction  What is the Difference between DispatchAction and LookupDispatchAction
difference between SessionState and ViewState
difference between SessionState and ViewState  What is the difference between SessionState and ViewState
difference between ForwardAction and IncludeAction
difference between ForwardAction and IncludeAction  What is the difference between ForwardAction and IncludeAction
Difference between struts and JSF
Difference between struts and JSF  What is the difference between struts and JSF
difference between == and === operators?
difference between == and === operators?  Is (====) operator available in java or not? difference between
Difference between 3d and 4d
Difference between 3d and 4d  what is the difference between 3d and 4d
What is the difference between the >> and >>> operators?
What is the difference between the >> and >>> operators?   hi, What is the difference between the >> and >>> operators? Thanks
difference between varchar & varchar2?
difference between varchar & varchar2?  What is the difference between varchar & varchar2
Difference between Mysql and SQL
Difference between Mysql and SQL  hello, What is the difference between Mysql and SQL??   hii,ADS_TO_REPLACE_1 SQL is structural quary language but mysql is database package
Difference between Timer and Thread?
Difference between Timer and Thread?  Can anyone tell me about the difference between Timer and Thread, Why we need to have Timer in case we have Thread implimentation startegy in Java
what is the difference between extends and implements
what is the difference between extends and implements  difference between extends and implements
what is the difference between extends and implements
what is the difference between extends and implements  difference between extends and implements
Difference between SCJP Exams
Difference between SCJP Exams  What is the differences between SCJP 5 (310 - 055) exam and SCJP 6 (310 - 065) exam??? Thank You In Adv
Difference between JSP and Servlets
Difference between JSP and Servlets  What is the difference between JSP and Servlets ?   JSP is used mainly for presentation only. A JSP can only be HttpServlet that means the only supported protocol in JSP is HTTP
difference between lock and synchronization
difference between lock and synchronization  Hi, I am new in java please anyone tell me difference between lock and synchronization in java. its urgent. Thank in advance   Please visit the following link: Lock
Difference between request.getRequestDispatcher() and context.getRequestDispatcher()
Difference between request.getRequestDispatcher() and context.getRequestDispatcher()  What is the difference in using request.getRequestDispatcher() and context.getRequestDispatcher()?   request.getRequestDispatcher
Difference between forward and sendRedirect
Difference between forward and sendRedirect  What's the difference between forward and sendRedirect?   RequestDispatcher.forward() and HttpServletResponse.sendRedirect() are the two methods available for URL redirecting
Difference between translate and replace
Difference between translate and replace   hiii, What is the difference between translate and replace?   hello,ADS_TO_REPLACE_1 Replace replace every instence of character with character sting by the given charator
Difference between ServletContext and ServletConfig
Difference between ServletContext and ServletConfig   What is the difference between ServletContext and ServletConfig?   ServletContext :Defines a set of methods that a servlet uses to communicate with its servlet
Difference between GET and POST
Difference between GET and POST   Difference between GET and POST ?   The difference between a GET and a POST is the way data is transferred to a servlet. With a GET, the URL will show each name/value pair on the query
What is the difference between PHP4 and PHP5?
What is the difference between PHP4 and PHP5?  What is the difference between PHP4 and PHP5
What is difference between a PROCEDURE & FUNCTION ?
What is difference between a PROCEDURE & FUNCTION ?  What is difference between a PROCEDURE & FUNCTION
Difference between XML and HTML - XML
Difference between XML and HTML  What is the basic Difference between XML and HTML
difference between <%@ include ...> and <jsp:include>
difference between <%@ include ...> and   What is the difference between <%@ include ...> (directive include) and <jsp:include>
What is the difference between $message and $$message?
What is the difference between $message and $$message?  What is the difference between $message and $$message
what is the Difference between weblogic and jboss?
what is the Difference between weblogic and jboss?  what is the Difference between weblogic and jboss
what is the difference between pop and oop
what is the difference between pop and oop  what is the difference between pop and oop
difference between hashcode,reference in java
difference between hashcode,reference in java  difference between hashcode,reference in java
What is the difference between hibernate and spring
What is the difference between hibernate and spring  Hi, What is the difference between hibernate and spring. Thanks
Difference between http and https
Difference between http and https  Difference b/w HTTP and HTTPS please provide answer in tabular form.   Hi Friend, Differences: 1)HTTP is hyper text transfer protocol which is responsible for transmitting
What is the difference between a constructor and a method?
What is the difference between a constructor and a method?  Hi, What is the difference between a constructor and a method?   Hi, I have found a good link of Java program related to difference between constructor
Difference between error and exception ????????
Difference between error and exception ?  Can we handle a error in java if yes than give an code of an example? Difference between error and exception handling.......   Exceptions are things you can create/throw
difference between applet and swings
difference between applet and swings  what are the major difference between swing and applets   Hello Friend, Differences:ADS_TO_REPLACE_1..._TO_REPLACE_3 Thanks   Hi Friend, Difference between Swing and Applet:ADS
Difference between jsonstring and json object
Difference between jsonstring and json object  Is There any difference between JsonString and jsonobjectA? if there is any differece could any one explain with example. Thanks venkatesh
Difference between Struts and Spring
Difference between Struts and Spring  What are the difference between Struts and Spring?   Hi Friend, Differences: 1)Struts is a web framework while Spring is not. 2)Spring is a Layered Architecture while Struts
difference between $message and $$message
difference between $message and $$message  What is the difference between $message and $$message?   Hi friends, $message is a simple variable whereas $$message is a reference variable. Example: $name = 'Bharat
What is difference between the java and javascript?
What is difference between the java and javascript?  What is the difference beteen the java and javascript?   Hello Friend, Read HereADS_TO_REPLACE_1 Thanks
calculate difference between two dates
calculate difference between two dates  hi, I was actually working on to calculate the number of days between two dates of dd/mm/yyyy format... the difference between the two dates
Difference between MVC1 And MVC2 - Struts
Difference between MVC1 And MVC2  HI Friends,Can u Give me difference between mvc1 and mvc2. Thanks Prakash  Hi Friend, Please visit the following link: http://www.roseindia.net/struts/mvc-architecture.shtml
Difference between and merge and update in hibernate
Difference between and merge and update in hibernate  What is difference between and merge and update in hibernate?   Use update() if you are sure that the session does not contain an already persistent instance
difference between prepared statement and statement
difference between prepared statement and statement  i mean in prepared statement we write insert command as INSERT INTO tablename VALUES...(),jtextfield2.getText()); whats the difference between these two and which is more
mysql difference between two numbers
mysql difference between two numbers  How to get total bate difference between two dates for example 1/01/2012 and 1/02/2012 in MYSQL?   ..., '01/02/2012', 103))   DATEDIFF() in MYSQL always returns the difference
What is the difference between a JDK and a JVM?
What is the difference between a JDK and a JVM?  Hi, What is the difference between a JDK and a JVM? Thanks,   Hi, JDK is stand... to compile your source files using a JVM. For more difference between JDK and JVM
difference between the obj and reference - Java Beginners
difference between the obj and reference  what is the difference between object and reference ? is there any difference
Difference between httpService and Data Service
Difference between httpService and Data Service  Hi.. Please tell me What is the difference between httpService and Data Service? Thanks  Solution: When we use flex Data Services we have to need
difference between servletconfig and servletcontext in java
difference between servletconfig and servletcontext in java  difference between servletconfig and servletcontext in java   ServletContext ServletContext is implemented by the servlet container for all servlet
difference between enum and final class?
difference between enum and final class?  what is the difference between enum and final class in java?   The java.lang.Enum is an abstract class, it is the common base class of all Java language enumeration types
difference between wite and writeto in java
difference between wite and writeto in java  I am using the stream to write content to the file.I am using write() method but my friend suggest the writeTo() method. I want to know difference between the write() and writeTo

Ads