SQL help could be used

Discussion in 'Off Topic Discussion' started by ASSEMbler, Mar 25, 2010.

  1. ASSEMbler

    ASSEMbler Administrator Staff Member

    Joined:
    Mar 13, 2004
    Messages:
    19,394
    Likes Received:
    995
    There's a problem with VBB as it will crash with a session table overflow.
    Basically I need to run a script to dump the table every few days.

    Anyone can advise on a way to empty table "session".

    If I get the sql query syntax I can automate it.
     
  2. karsten

    karsten Member of The Cult Of Kefka

    Joined:
    Mar 14, 2004
    Messages:
    4,015
    Likes Received:
    149
    this was the reason i couldn't connect all the day?
     
  3. ASSEMbler

    ASSEMbler Administrator Staff Member

    Joined:
    Mar 13, 2004
    Messages:
    19,394
    Likes Received:
    995
    Yeah it's a flaw in vbulletin...
     
  4. madhatter256

    madhatter256 Illustrious Member

    Joined:
    Mar 13, 2004
    Messages:
    6,578
    Likes Received:
    4
  5. Tenchi

    Tenchi Spirited Member

    Joined:
    Jul 29, 2008
    Messages:
    186
    Likes Received:
    2


    TRUNCATE
    TABLE "table_name"

    this is the way how it works with an oracle database, it deletes all data from a table :D so ya can make the table empty from its data only
     
    Last edited: Mar 25, 2010
  6. Hellcat

    Hellcat Robust Member

    Joined:
    Jun 9, 2009
    Messages:
    200
    Likes Received:
    1
    Yup, works for (My)SQL same way.

    Is that what you need, or only part of the table's content (like "everything but todays sessions")?
     
  7. ASSEMbler

    ASSEMbler Administrator Staff Member

    Joined:
    Mar 13, 2004
    Messages:
    19,394
    Likes Received:
    995
    Yes, jut empty the table's fields not drop the fields.
     
  8. Taucias

    Taucias Site Supporter 2014,2015

    Joined:
    Oct 11, 2005
    Messages:
    5,015
    Likes Received:
    17
    Use a truncate statement and set it up as a Cron job, like this: http://community.contractwebdevelopment.com/cron-job-mysql

    Or you could manually run the truncate statement such as TRUNCATE TABLE <tablename>.

    Truncate will just clear the rows, the column definitions will remain.

    Maybe you could also do it with a trigger?
     
    Last edited: Mar 26, 2010
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page