<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Subquery too deep</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Subquery too deep</description>
  <pubDate>Thu, 11 Jun 2026 21:11:48 -700</pubDate>
  <lastBuildDate>Mon, 10 Sep 2007 08:49:08 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=320</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Subquery too deep : I think you should be able to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=320&amp;PID=1132#1132</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=120" rel="nofollow">m2r4miller</a><br /><strong>Subject:</strong> 320<br /><strong>Posted:</strong> 10-Sep-2007 at 8:49am<br /><br /><P>I think you should be able to rewrite the query like this to get the same results:</P><DIV>... where &#091;ThisID&#093; in (Select &#091;ID&#093; from &#091;Bar&#093;&nbsp;where &#091;foo&#093; in (A, B, C, D, E ...))</DIV><DIV>&nbsp;</DIV><DIV>That streamlines the SQL generated which should allow a great deal more possibilities for &#091;foo&#093;.</DIV><DIV>&nbsp;</DIV><DIV>-Mark</DIV>]]>
   </description>
   <pubDate>Mon, 10 Sep 2007 08:49:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=320&amp;PID=1132#1132</guid>
  </item> 
  <item>
   <title>Subquery too deep : .NET has a limit that used to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=320&amp;PID=745#745</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=43" rel="nofollow">pkarsh</a><br /><strong>Subject:</strong> 320<br /><strong>Posted:</strong> 20-Jul-2007 at 5:13pm<br /><br />.NET has a limit that used to be 8000 characters to a query.  I don't know offhand if the limit is higher under .NET 2.0.  I suspect that the limit you ran into was not in the length of subquery clauses, but rather in the length of the SQL query that was generated from your query.  IN clauses can generate this problem because the SQL that is generated will add a term for each result of the IN clause.  If there are a large number of terms that satisfy that clause, that can drive the number of characters beyond .NET's limit.<br /><br />It looks like you discovered the correct workaround yourself.<br /><br />You can see the SQL that is generated by an application by looking in the DebugLog that by default is created in the directory where the executable runs.<br />]]>
   </description>
   <pubDate>Fri, 20 Jul 2007 17:13:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=320&amp;PID=745#745</guid>
  </item> 
  <item>
   <title>Subquery too deep : During some development, I ran...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=320&amp;PID=738#738</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=31" rel="nofollow">gjsdb</a><br /><strong>Subject:</strong> 320<br /><strong>Posted:</strong> 20-Jul-2007 at 9:52am<br /><br />During some development, I ran into an error message regarding a Subquery (or set of Subqueries).<DIV>&nbsp;</DIV><DIV>In effect, I was adding Subqueries to Subselect items from a query such that: </DIV><DIV>&nbsp;</DIV><DIV>... where &#091;ThisID&#093; in (Select &#091;ID&#093; from &#091;Bar&#093;&nbsp;where (&#091;foo&#093; = A) or (&#091;foo&#093; = B) or (&#091;foo&#093; = C) .... and they tell two friends and they tell two friends...</DIV><DIV>&nbsp;</DIV><DIV>The runtime error implied that the subquery was "too deep."&nbsp; This was confusing because the number of Subqueries&nbsp;in my application&nbsp;had not changed.&nbsp; However, the number of Clauses added to the Subquery had increased (dramatically).</DIV><DIV>&nbsp;</DIV><DIV>I throttled the number of clauses that are added to any subquery and the error went away.</DIV><DIV>&nbsp;</DIV><DIV>However, this raises a question.&nbsp; What is the "length," if that's what one can call it, of a set of subquery clauses?&nbsp; I think this is the cause of my error.&nbsp; I think I was adding too many clauses to a particular subquery and the length was too much.</DIV><DIV>&nbsp;</DIV><DIV>Does anyone have any experience or ideas?</DIV><DIV>&nbsp;</DIV><DIV>I corrected the problem (probably caused by a bad pattern on my part) but I'm still curious.</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 20 Jul 2007 09:52:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=320&amp;PID=738#738</guid>
  </item> 
 </channel>
</rss>