Memory allocation failure

Posted on 2004-11-11
Last Modified: 2008-02-01

Im running a VB program that updates my SQLserver 7 DB via an odbc connection.

I had a "Memory allocation failure" error on an update that I though was very simple see below

ccount = 1
refid = 018595

update TBL1 set fileCount = '" & ccount & "' where refid = '" & refid & "'

As I understand an update it will only updates the "SET" column and will only modify that element yet I got the Memory allocation failure error ???

is this right what iv been told that an update does not pull out the complete record contents when a set column is defined, it only modifies the column named in the SET ??? yes ???

What could cause this error ??
Question by:itimes
    LVL 7

    Expert Comment

    if you run your transaction in query analyzer what you get ?


    Author Comment


    I haven trun this is query analyzer but i hace run my prgrams isnce after a machine restarts and its working fine ... ?!?!?!

    Is this correct what iv been told though ???

    "that an update does not pull out the complete record contents when a set column is defined, it only modifies the column named in the SET"
    LVL 15

    Expert Comment

    Hi itimes,

    Yes that is correct, the update statement you have would only make a change to the fileCount column where the refid is equal to what you have specified
    LVL 6

    Accepted Solution

    So the program runs fine after a restart.  That just screams memory leak to me.

    SQL Server 7 was bad about that until service pack 3, run
    select @@version
    check against the website below:

    Also check your VB app for memory leaks.  You can do it manually or buy a product that will do it for you.  I never wrote VB, so I can't recomend a product that will do that for VB.  (I did write C, C++, C# for year and know good ones for that)

    LVL 7

    Expert Comment

    I agree with duanelawrence  point, I think it is a memory leak
    LVL 50

    Expert Comment

    for info.
      the update only affects the namend column
      whatever data the dbms have to use to identify that column depends on the indexes / access strategy it
       needs to use to navigate to those rows...
      dependant on the column type and indexes upon whihc the updated column resides additional work maybe required
       to move data rows within the affected pages/ split / join pages depending on the increase/decrease in particular
       row data sizes, that could get more complicated if a text or image column is in the row and the store data within the page option is also specified....


    Author Comment

    Thank you for all teh info about the UPDATE statement ... My SQL was simple and it turned out to be a memory (memory leak) problem ... rebuilt software onto 2000 instaed of 98 and has run for teh last 7 days straight with no problems !!!

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Introduced in Microsoft SQL Server 2005, the Copy Database Wizard ( is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
    Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now