Out of Memmory exception

  • Hi...when I run the following query I get the error message....

    An error occurred while executing batch. Error message is: Exception of type 'System.OutOfMemoryException' was thrown.

    SELECT SOP.DOCDATE,

    SOP.SOPNUMBE,

    SOP.CSTPONBR,

    SOP.SUBTOTAL,

    SOP.TAXAMNT,

    SOP.DOCAMNT,

    SOP.POSTEDDT,

    T2.CUSTNMBR,

    T2.CUSTNAME,

    T2.PYMTRMID,

    T2.PHONE3

    FROM RM T2 (NOLOCK)

    INNER JOIN SOP (NOLOCK) ON T2.CUSTNMBR=SOP.CUSTNMBR

    WHERE SOP.DOCAMNT>0

    ORDER BY T2.CUSTNMBR,

    SOP.SOPNUMBE

    How to solve this problem?? Please suggest me...Thank you

  • There is that NOLOCK query hint again...this hint should really be avoided, do you understand that it can not only cause you to read uncommitted data, but also miss committed data or read it multiple times?

    On to the issue, are you getting the error in a dialog window, or are you getting it in the message pane in management studio? How long does the query run before the message appears? It looks like the message management studio gets when it runs out of buffer space trying to generate the results in a grid. Have you tried returning the results to text or a file rather than the management studio results grid?

  • Do you have reporting services installed?

    http://support.microsoft.com/default.aspx?scid=kb;en-us;840709



    Shamless self promotion - read my blog http://sirsql.net

  • Thank you both for your quick replies....Actually It has got some trillions of data, so I got to change the query design itself....@Michael, The suggestion u gave is very informative and thanks a lot for that....

    I just changed the query which gives me in thousands...so everything is fine now...

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply