CrazyEngineers
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Kaustubh Katdare

    AdministratorNov 25, 2008

    babloo0311
    Hi friends,

    what is the difference between delete and trancate command
    Its 'truncate', I think.
    Are you sure? This action cannot be undone.
    Cancel
  • manupep

    MemberNov 25, 2008

    Is there any command 'delete' ?
    I think 'drop table' is the command used to delete one table.
    'truncate' will delete only the contents of the table . The table structure should remain. we can add datas further.
    Are you sure? This action cannot be undone.
    Cancel
  • Prasad Ajinkya

    MemberNov 25, 2008

    Well, you can also use delete from <table_name> command to delete only the contents of the table. Schema will remain intact though.
    Are you sure? This action cannot be undone.
    Cancel
  • manupep

    MemberNov 26, 2008

    oh! yes 'delete' is there to delete rows according to condition.
    Are you sure? This action cannot be undone.
    Cancel
  • shalini_goel14

    MemberNov 26, 2008

    Hi Babloo

    1. TRUNCATE : You can't use WHERE clause
    DELETE : You can use WHERE clause

    2. TRUNCATE : You can't use WHERE clause
    DELETE : You can use WHERE clause

    3. Delete - delete deletes the records from table it can be rollbacked also you can give the where condiition to it.
    Truncate - delete all records from table There is no rollback it always commit without giving the commit command

    TRUNCATE is a DDL command and cannot be rolled back and All of the memory space is released back to the server. It can not use the Where conditions. DELETE is a DML command and can be rolled back. here can be use where conditions. TRUNCATE is much faster but don not use it if delete can work.
    Are you sure? This action cannot be undone.
    Cancel
  • babloo0311

    MemberNov 26, 2008

    yeah thanks buddy
    Are you sure? This action cannot be undone.
    Cancel
  • manupep

    MemberNov 26, 2008

    oh! so much infos .Thanks shalini.
    Are you sure? This action cannot be undone.
    Cancel
  • shalini_goel14

    MemberNov 27, 2008

    Always welcome 😀 .

    Sorry for Duplicate points:

    1. TRUNCATE : You can't use WHERE clause
    DELETE : You can use WHERE clause

    2. TRUNCATE : You can't use WHERE clause
    DELETE : You can use WHERE clause
    Are you sure? This action cannot be undone.
    Cancel
  • babloo0311

    MemberNov 27, 2008

    yeah no probs
    Are you sure? This action cannot be undone.
    Cancel
  • Prasad Ajinkya

    MemberNov 27, 2008

    Wow! Good tips Shalini!!
    Are you sure? This action cannot be undone.
    Cancel
  • zia.sepsis

    MemberDec 30, 2008

    Truncate table does not support the Where clause. In addition, the Truncate table statement does not fire a trigger. When truncate is used, the deleted rows are not entered in the transaction log. there fore it can't be rolled back. when the delete command is used , it creates a transaction log file which help you in the process of rollback.
    the syntax of truncate statement is:-
    truncate table table_name
    the syntax of delete statement is:-
    delete table_name

    both the statements is used to delete all the records form the table
    correct me if am wrong 😁
    Are you sure? This action cannot be undone.
    Cancel
  • HEART-HACKER

    MemberDec 30, 2008

    I think you got your ANS 😁
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register