1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to delete all table's data

Discussion in 'Databases' started by getbestproduct, Dec 23, 2010.

  1. shiva0077

    shiva0077 Peon

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #21
    Query for deleting the data from table is
    DELETE FROM students
    WHERE id = 410
     
    shiva0077, Jul 5, 2011 IP
  2. mmerlinn

    mmerlinn Prominent Member

    Messages:
    3,197
    Likes Received:
    818
    Best Answers:
    7
    Trophy Points:
    320
    #22
    Drag it to the Trash or Recycle icon.
     
    mmerlinn, Aug 13, 2011 IP
  3. shanmarsh1

    shanmarsh1 Peon

    Messages:
    81
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #23
    The method shown before (Select 'delete from ' + name from Sysobjects where Type='u' order by name) returns also dtproperties table, wich you might not want to delete. If so, add 'status>0' where clause, status coming from Sysobjects table.
     
    shanmarsh1, Sep 19, 2011 IP
  4. akumar2

    akumar2 Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #24
    just backup all data structure & delete all table & restore table structure ;)
     
    akumar2, Sep 20, 2011 IP
  5. sandeepsabir

    sandeepsabir Greenhorn

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #25
    Delete from table_name
     
    sandeepsabir, Sep 25, 2011 IP
  6. dominic11

    dominic11 Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #26
    for this we use DELETE option.
     
    dominic11, Sep 28, 2011 IP
  7. srishtimehta

    srishtimehta Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #27
    You can use this Query to empty table

    TRUNCATE TABLE "table_name" ;

    It can delete all data of the table..
     
    srishtimehta, Oct 19, 2011 IP
  8. dominic11

    dominic11 Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #28
    Yeah it can be an appropriate option to perform such kind. thanks



    -------------------------------------
    Free software download
     
    dominic11, Nov 1, 2011 IP
  9. alice757

    alice757 Guest

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #29
    In SQL: you can use Delete from your tablename
     
    alice757, Nov 4, 2011 IP
  10. jaffary.vincent

    jaffary.vincent Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #30
    Simply write the code


    trucate table Table_Name

    This is the query:- Truncate table is keyword for deleting all the table in particular database. and write the name of the table name which you want to be deleted in the place of table_Name
     
    jaffary.vincent, Nov 14, 2011 IP
  11. sajiddesigner

    sajiddesigner Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #31
    To delete data do

    DELETE FROM "table_name";
     
    sajiddesigner, Nov 14, 2011 IP
  12. simrankim

    simrankim Member

    Messages:
    143
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #32
    Delete data from table

    Ex.
    Ex. SQL query
    sql-> delete from students
    where students is name of table. It deletes all data from table

    sql-> delete from students where id=20
    It deletes particular record from table.
     
    simrankim, Nov 18, 2011 IP
  13. nisha134

    nisha134 Peon

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #33
    truncate table table name.all the table deleted no structure left ....
     
    nisha134, Dec 2, 2011 IP
  14. fithraw

    fithraw Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #34
    Use:
    TRUNCATE table_name;
    It will erasing/ make your table data's empty. :)
     
    fithraw, Dec 8, 2011 IP
  15. Deltahost

    Deltahost Banned

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    108
    #35
    truncate table table_name;
     
    Deltahost, Dec 9, 2011 IP
  16. tricialicious

    tricialicious Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #36
    truncate or drop
     
    tricialicious, Dec 22, 2011 IP
  17. cheenki

    cheenki Peon

    Messages:
    59
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #37
    Truncate table “table_name”;
    Ex: Truncate table Bank_employee;
    If you want to deleted particular records then use this query
    Delete from “table_name” Where “condition”;
    Ex: Deleted from Bank_employee where employee_name=abc and employee_id=2;
     
    cheenki, Jan 10, 2012 IP
  18. NothingLikeThis

    NothingLikeThis Member

    Messages:
    113
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #38
    truncate command do this task
     
    NothingLikeThis, Jan 11, 2012 IP
  19. mmerlinn

    mmerlinn Prominent Member

    Messages:
    3,197
    Likes Received:
    818
    Best Answers:
    7
    Trophy Points:
    320
    #39

    TRUNCATE and DROP do NOT exist in FoxPro.
     
    mmerlinn, Jan 11, 2012 IP
  20. cashcars

    cashcars Peon

    Messages:
    112
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #40
    Is there an easy way to delete all data from all nonsystem tables in a given sql server 2000 database?

    Right now i have about 50 tables that i want to clear data out of and want to know if there is an easier way than

    Delete from <mytable>

    For each table i want to clear data out of.
     
    cashcars, Jan 13, 2012 IP