C# string and ExecuteNonQuery - Out of Memory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • flamz
    New Member
    • Feb 2007
    • 2

    C# string and ExecuteNonQuery - Out of Memory

    Hello,
    I have a T-SQL script which weights around 24mb in size (yeah, it's pretty big) and I need my web server to execute it (using Sql.Connection. ExecuteNonQuery ).
    It works fine on my development environement (it takes a while to perform the call, but that's OK). But when I try it on my web server, it runs out of memory.

    Actually, it looks it's the C# string that runs out of memory.

    My .NET process is assigned around 250MB of memory so, not sure what's going on.

    Does anyone have any tips on how to execute such a huge query in one call?

    cheers
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Make your query be a stored procedure instead of an inline string in code.
    Then you can just call the procedure by name (and pass in any parameters if need be) from code and get the same result set.

    Comment

    Working...