SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: deleting tables

  1. #1
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    deleting tables

    How can I delete a table from a database?

    thanks for any help

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,267
    Mentioned
    116 Post(s)
    Tagged
    1 Thread(s)
    Use the DROP Table command
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  3. #3
    SitePoint Enthusiast numeropi's Avatar
    Join Date
    Apr 2001
    Location
    somewhere between 3.14 and 3.15
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to delete only the records but keep the table, then

    Code:
    DELETE FROM tablename;
    else, if you really want to get rid of the table itself (along with all records),

    Code:
    DROP TABLE tablename;
    Just make sure this is what you want before actually doing it
    No más enlaces rotos en el correo: EnlaceBreve.com
    Tu bitácora en castellano: BitacoraFacil.com

  4. #4
    Yugo full of anvils bronze trophy hillsy's Avatar
    Join Date
    May 2001
    Location
    :noitacoL
    Posts
    1,859
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DROP TABLE <Name>;

    Be careful

    <edit>
    Oh man, how many other people can reply in the time it takes me to write "Drop Table"?
    </edit>
    that's me!
    Now A Pom. And a Plone Nut
    Broccoli Martinez Airpark

  5. #5
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink Cheers


    Hehe thanks for the help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •