title: Intermittent "Out of present range" from Classic ASP after migration from SQL Server 2000 to 2008 & IIS6-IIS7
body: <p>Background: I have just completed a move of approximately 50 classic ASP sites from an IIS6/Sever 2003 and SQL Server 2000 environment to a new virtual environment of 2 machines behind an nginx load balancer. Each MS machine is running IIS7.5 and SQL Server 2008 R2. They current each have 6Gb &amp; 2 VCPUs. The databases are set up in a mirroring configuration (currently without a witness).</p>
  
  <p>During testing all sites appeared to function correctly.</p>
  
  <p>Once live traffic started to hit the sites it became apparent quite quickly that the initial resource allocation (2Gb &amp; 1 VCPU was way too low and was quickly increased). The main problem has come from an intermittent ASP error occuring on approximately 10 (and probably including the busiest) sites on the servers. They will produce a 500 response from an ASP error of </p>
  
  <blockquote>
    <p><em>Provider error '8002000a'  Out of present range.</em></p>
  </blockquote>
  
  <p>All research has pointed to causes such as numbers too large to fit into an integer variable and some people have mentioned some correlation with the newer implementation of <code>RAND</code> and <code>NEWINT()</code> in SQL Server 2008 compared to 2000. The stored procedures that appear to cause the error are relatively simple, with some as simple as accepting a single <code>VARCHAR</code> parameter (well within the limits) and doing a single column select on a table. Most do not even involve <code>INT</code>s at all and if they do, the values are well within range. </p>
  
  <p>The error can appear on one machine for a given amount of time while during this same time the other server will not necessarily have the error, it sometimes will though. After a while the error will stop occurring, this doesn't seem to correlate with excessively overloaded system resources either.</p>
  
  <p>ASP to database is done via a DSN using SQL Server Client 10 drivers. The code is using the ADODB connection and command objects. This code has been working happily for 6+ years on the previous servers. The databases are set to compatibility mode 80 (SQL Server 2000).</p>
  
  <p>Can anyone shed any light on where I should be looking to try and solve this please? If there is any other information I can share, specific code snippets etc please just let me know.</p>
  
  <p>Update:
  I thought the <code>UPDATEUSAGE</code> answer below had got it but unfortunately it reared up again a little later. After some thinking I've had the following thoughts... There are two instances of IIS, independent of each other, they both talk to a single database whether it be local at the time or not, they both execute identical sync'd code with code that has been working with the same syntax and valid variables for a long time. As the ASP execution through IIS is the only layer in this equation that is not a single point as it were this is where I've headed. When the problem reoccurred, I restarted IIS on the machine at that point that was showing the error (the situation is often that it is only occurring on one of the two servers). The restart of IIS appeared to cure the problem. It then happened on the other server with a different site, again restarting IIS appeared to sort the issue.</p>
  
  <p>Further reading has now lead me to the "Managed pipeline" modes of the app pools. They are currently set to "Integrated". I've done some reading and I'm wondering if they should be set to classic to emulate IIS6. Does anyone have any more thoughts on this?</p>
  
  <p>Many thanks
  Eric</p>