title: A timeout occurred while waiting for memory resources to execute the query in resource pool 'internal' (1). Rerun the query
body: <p>When I run this query</p>
  
  <pre><code>Select         
  -- Generate the row number        
  ROW_NUMBER() over(order by MenuOrder) as 'rownum',        
  -- get the minimum data from query        
  (Select top 1 ROW_NUMBER()over(order by MenuOrder)          
  from SitePage where ActiveFlag='true' AND SiteId=1083 and LanguageId=159 AND ChildOf=0 order by MenuOrder asc) as 'min',        
  -- get the maximum data from query        
  (Select top 1 ROW_NUMBER()over(order by MenuOrder)  from SitePage where ActiveFlag='true' and LanguageId=159 AND SiteId=1083 AND ChildOf=0         
  order by MenuOrder desc) as 'max',        
  -- get rest of all details        
  ,(case when exists(select from SitePage where ChildOf = AP.SitePageId and ActiveFlag =1  ) then 'Y' else 'N' end) as [Type]  from SitePage AP 
  where ActiveFlag=1 AND SiteId=1083 AND ChildOf=0 and LanguageId=159 order by MenuOrder
  </code></pre>
  
  <p>then i got the following error </p>
  
  <p><strong>"A timeout occurred while waiting for memory resources to execute the query in resource pool 'internal' (1). Rerun the query."</strong></p>
  
  <p>I am using Sql Server 2008 R2  <strong>Version 10.50.4000.0</strong></p>
  
  <p><strong>query wait time is 1</strong></p>
  
  <p><strong>Maximum server memory is 12288 MB</strong></p>