<?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 : Get SQL from query</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2012 : Get SQL from query</description>
  <pubDate>Sat, 11 Apr 2026 19:09:03 -700</pubDate>
  <lastBuildDate>Wed, 19 Jun 2013 20:26:34 -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=4174</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>Get SQL from query : Murray,You will not be able to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16463#16463</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 4174<br /><strong>Posted:</strong> 19-Jun-2013 at 8:26pm<br /><br />Murray,<div><br></div><div>You will not be able to do this by getting the SQL from an EntityQuery.</div><div><br></div><div>The choice is to use a stored procedure, but like you mentioned "there&nbsp;<span style=": rgb251, 251, 253; line-height: 1.4;">is the potential for there to be far to many" (guids). What I can think of is that if the list of guids grow too big, split it and make multiple stored procedure calls.</span></div><div><br></div><div>Unfortunately, I can't think of any other option to deal with this sort of bulk operation.&nbsp;</div><div><br></div>]]>
   </description>
   <pubDate>Wed, 19 Jun 2013 20:26:34 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16463#16463</guid>
  </item> 
  <item>
   <title>Get SQL from query : Hi SbeliniI am still waiting on...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16461#16461</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1375" rel="nofollow">murray.bryant</a><br /><strong>Subject:</strong> 4174<br /><strong>Posted:</strong> 19-Jun-2013 at 6:52pm<br /><br />Hi Sbelini<div><br></div><div>I am still waiting on your response on this issue</div><div><br></div><div>thanks</div><div><br>Murray<br><div><br></div><div><br></div></div>]]>
   </description>
   <pubDate>Wed, 19 Jun 2013 18:52:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16461#16461</guid>
  </item> 
  <item>
   <title>Get SQL from query : Hi CefernanThanks for the suggestion,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16429#16429</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1375" rel="nofollow">murray.bryant</a><br /><strong>Subject:</strong> 4174<br /><strong>Posted:</strong> 13-Jun-2013 at 5:26pm<br /><br />Hi Cefernan<div><br></div><div>Thanks for the suggestion, however performance wise doing tens of thousands of inserts into a table through devforce would be terrible.</div><div><br></div><div>The only way to do the insert would be to bypass devforce completely. Which I am trying not to do.&nbsp;</div>]]>
   </description>
   <pubDate>Thu, 13 Jun 2013 17:26:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16429#16429</guid>
  </item> 
  <item>
   <title>Get SQL from query : murray.bryant,As an alternative,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16428#16428</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1485" rel="nofollow">cefernan</a><br /><strong>Subject:</strong> 4174<br /><strong>Posted:</strong> 13-Jun-2013 at 6:56am<br /><br /><span style=": rgb251, 251, 253;">murray.bryant,&nbsp;</span><div><span style=": rgb251, 251, 253;"><br></span></div><div><span style=": rgb251, 251, 253;">As an alternative, you can put necessary data in a temporary table in database and the stored procedure can read those rows and do what need to be done.</span></div>]]>
   </description>
   <pubDate>Thu, 13 Jun 2013 06:56:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16428#16428</guid>
  </item> 
  <item>
   <title>Get SQL from query :   I have a stored procedure...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16426#16426</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1375" rel="nofollow">murray.bryant</a><br /><strong>Subject:</strong> 4174<br /><strong>Posted:</strong> 13-Jun-2013 at 2:38am<br /><br />I have a stored procedure that processes some data and returns the results. I am using a stored procedure to process this data on the sql server for performance reasons.<div><br></div><div>The user can filter what data they want processed ( Ie which locations they want the data processed for). I determine the locations that they are interested on the client by building a IPredicateDescription and then doing a typed entity query. This will give me a list of the locations on the client.</div><div><br>My problem is passing the list of locations ( id guids) back to the server so that the stored procedure can run and make the results for those locations.&nbsp;</div><div><br></div><div>The most elegant method I can come up with is to extract the SQL from the entity query, &nbsp;pass that string to the server stored procedure and get the results back.</div><div><br></div><div>I have considered the following</div><div>- I can't pass a list of Guids to the server because there is the potential for there to be far to many.</div><div>- I can't do one at a time because the time cost of calling the stored procedure through devforce is too great</div><div>- If i could pass a table of results to the stored procedure this might work, though I am not sure it is supported and it would not have as good a performance as just passing the sql</div><div><br></div><div>Does this make sense?</div><div><br></div><div>thanks for your help</div><span style="font-size:10px"><br /><br />Edited by murray.bryant - 13-Jun-2013 at 2:49am</span>]]>
   </description>
   <pubDate>Thu, 13 Jun 2013 02:38:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16426#16426</guid>
  </item> 
  <item>
   <title>Get SQL from query : murray.bryant,Regarding the post...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16422#16422</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 4174<br /><strong>Posted:</strong> 13-Jun-2013 at 1:37am<br /><br /><div>murray.bryant,<div><br></div><div>Regarding the post at&nbsp;<a href="http://www.ideablade.com/forum/forum_posts.asp?TID=2793&amp;title=feature-request-support-totracestring-&#111;n-a-perquery-basis" target="_blank">http://www.ideablade.com/forum/forum_posts.asp?TID=2793&amp;title=feature-request-support-totracestring-on-a-perquery-basis</a>,&nbsp;<span style="line-height: 1.4;">it's unlikely that casting EntityQuery to ObjectQuery will be possible.</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">I'm confused as to what you are trying to accomplish. You mentioned that you "</span><span style=": rgb251, 251, 253; line-height: 1.4;"><i>need to pass this &nbsp;dynamic where statement into a stored procedure to return data ( for performance reasons)</i></span><span style="line-height: 1.4;">", but then suggest that an "</span><span style=": rgb251, 251, 253; line-height: 1.4;"><i>option would be to execute the query on the client then pass the colleciton of results back to the server for processing</i></span><span style="line-height: 1.4;">"... I can't make sense of it.</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">Please explain in detail what you are trying to do, so we can better understand the problem and suggest an appropriate approach, since retrieving the SQL from an EntityQuery is not an option.</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">Regards.</span></div></div><div><span style="line-height: 1.4;"><br></span></div>]]>
   </description>
   <pubDate>Thu, 13 Jun 2013 01:37:37 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16422#16422</guid>
  </item> 
  <item>
   <title>Get SQL from query :  My other option would be to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16421#16421</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1375" rel="nofollow">murray.bryant</a><br /><strong>Subject:</strong> 4174<br /><strong>Posted:</strong> 12-Jun-2013 at 5:37pm<br /><br />My other option would be to execute the query on the client then pass the colleciton of results back to the server for processing.<div><br></div><div>This would need the use of Table values in Stored Procedures.</div><div><br></div><div>I know you can do this in EntityFramework ( see&nbsp;http://stackoverflow.com/questions/8157345/entity-framework-stored-procedure-table-value-parameter )</div><div><br></div><div>Would something like this work in DevForce?</div><div><br></div><div>I would worry about performance with this method still though.</div><div><br></div><div><br></div><span style="font-size:10px"><br /><br />Edited by murray.bryant - 12-Jun-2013 at 5:38pm</span>]]>
   </description>
   <pubDate>Wed, 12 Jun 2013 17:37:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16421#16421</guid>
  </item> 
  <item>
   <title>Get SQL from query : someone else requested this functionality...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16420#16420</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1375" rel="nofollow">murray.bryant</a><br /><strong>Subject:</strong> 4174<br /><strong>Posted:</strong> 12-Jun-2013 at 5:06pm<br /><br />someone else requested this functionality two years ago. But noone replied.<div><br><a href="http://www.ideablade.com/forum/forum_posts.asp?TID=2793&amp;title=feature-request-support-totracestring-&#111;n-a-perquery-basis" target="_blank">http://www.ideablade.com/forum/forum_posts.asp?TID=2793&amp;title=feature-request-support-totracestring-on-a-perquery-basis</a></div><div><br></div><div>did anything happen with this?</div>]]>
   </description>
   <pubDate>Wed, 12 Jun 2013 17:06:39 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16420#16420</guid>
  </item> 
  <item>
   <title>Get SQL from query : Ok can you think of a work around...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16419#16419</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1375" rel="nofollow">murray.bryant</a><br /><strong>Subject:</strong> 4174<br /><strong>Posted:</strong> 12-Jun-2013 at 5:01pm<br /><br />Ok can you think of a work around then?<div><br></div><div>At some point devforce does convert its queries into SQL statements. Is it in anyway possible to capture those statements?</div>]]>
   </description>
   <pubDate>Wed, 12 Jun 2013 17:01:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16419#16419</guid>
  </item> 
  <item>
   <title>Get SQL from query : murray.bryant,  Unfortunately...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16417#16417</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 4174<br /><strong>Posted:</strong> 12-Jun-2013 at 12:24pm<br /><br />murray.bryant,<br /><br />Unfortunately this is not possible in DevForce.<br />One of the main reasons is that DevForce is n-tier, so when a query is executed in the client, it is sent to the server as is. <br />Translating the EntityQuery into an "EF query" in order to obtain the corresponding SQL in the client wouldn't be feasible.<br />]]>
   </description>
   <pubDate>Wed, 12 Jun 2013 12:24:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16417#16417</guid>
  </item> 
  <item>
   <title>Get SQL from query : HiI have the need to extract the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16411#16411</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1375" rel="nofollow">murray.bryant</a><br /><strong>Subject:</strong> 4174<br /><strong>Posted:</strong> 12-Jun-2013 at 2:45am<br /><br />Hi<div><br></div><div>I have the need to extract the sql from a &nbsp;query into a string. I basically need to pass this &nbsp;dynamic where statement into a stored procedure to return data ( for performance reasons)</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div><div>&nbsp; var p1 = FilterViewModel.FilterPredicate;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ITypedEntityQuery query = EntityQuery.Create(entityType);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (p1 != null)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; query = query.Where(p1);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</pre></td></tr></table></div></div><div><br></div><div>in Entity Framework you can use the getcommand to return the sql statement as per&nbsp;<a href="http://msdn.microsoft.com/en-us/library/system.data.linq.datac&#111;ntext.getcommand.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.getcommand.aspx</a></div><div><br></div><div>Is there a way to do this with Ideablade?</div><div><br></div><div>thanks</div><div><br></div><div>Murray</div><div><br></div>]]>
   </description>
   <pubDate>Wed, 12 Jun 2013 02:45:30 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4174&amp;PID=16411#16411</guid>
  </item> 
 </channel>
</rss>