Results 1 to 4 of 4
  1. #1

    Angry How do I delete a MSSQL record

    Okay, I'm in enterprise manager, and ASP is giving me an error that looks like this:

    Response object error 'ASP 0251 : 80004005' 
    Response Buffer Limit Exceeded 
    /CorpAdmin/POList/PO_search.asp, line 0 
    Execution of the ASP page caused the Response Buffer to exceed its configured limit.
    Now I believe this has to do with ASP's default buffer. But, my database is extremely full, so instead of upping the buffer, I'd rather delete some records. ONly problem is, I didn't build this site, and I don't know anything about MSSQL can some one give me a SQL Query to run in Enterprise manager that will delete all records that have the value DateUpdated < 4/20/2004
    in other words, I want all records that haven't been updated for about a year to be deleted. Can anyone help me? - for sale!

  2. #2
    Do you have a way to enter mySQL queries?
    If so, then you first want to determine the name of the table:

    show tables;
    should give you a list of the tables in your database. If the records are in a single table then you can probably risk deleting them, but be careful as you can break things if you delete something that another table references. I would strongly advise backing up the mySQL database first. You can use something like:

    mysqldump -u<user> -p<passwd> <dbname> > <backupFileName>
    Anyway, to answer your question, let's assume the table name is myTable. Use the following command:

    DELETE FROM myTable WHERE DateUpdated<yourDate;
    To be safe, you can check your query syntax by using:

    SELECT * FROM myTable WHERE DateUpdated<yourDate;
    you should see a list of the records that match your date query. If this is correct, then do the DELETE.

  3. #3
    Join Date
    Jan 2004
    Texas, United States

    If you look closely, he mentioned Microsoft SQL Server. NOT MySQL.


  4. #4
    Join Date
    Dec 2004
    This should just be standard SQL. DELETE FROM table WHERE DateUpdate < 2004-04-20; (god I hate USA only date formats and the problems they cause).

    It sounds to me that your problems are with the code, however. I don't know a lot about ASP, but you should never have a result set large enough to overflow a buffer (this shouldn't even be *possible*, but that's MS for yah). As you said though, the code is not your own.

Posting Permissions

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