Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Memory allocation failure

Posted on 2004-11-11
Medium Priority
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

Expert Comment

ID: 12554080
if you run your transaction in query analyzer what you get ?


Author Comment

ID: 12554572

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

ID: 12554683
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Accepted Solution

Duane Lawrence earned 260 total points
ID: 12554755
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)


Expert Comment

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

Expert Comment

ID: 12556542
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

ID: 12642919
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

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

564 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