<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codehauerei Schwarz &#187; Rekursion</title>
	<atom:link href="http://codehauerei-schwarz.de/tag/rekursion/feed/" rel="self" type="application/rss+xml" />
	<link>http://codehauerei-schwarz.de</link>
	<description>.NET SQL-Server &#38; more</description>
	<lastBuildDate>Mon, 28 Mar 2011 08:38:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Rekursive SQL Queries &#8211; Common Table Expression</title>
		<link>http://codehauerei-schwarz.de/2009/11/02/rekursive-sql-queries-common-table-expression/</link>
		<comments>http://codehauerei-schwarz.de/2009/11/02/rekursive-sql-queries-common-table-expression/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 16:03:24 +0000</pubDate>
		<dc:creator>Andreas Schwarz</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[CTE]]></category>
		<category><![CDATA[Rekursion]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://codehauerei-schwarz.de/?p=89</guid>
		<description><![CDATA[CTE Rekursion &#8211; Sample   WITH TEMP (Pk, Parent_Pk, Title, Name, Iteration) AS (   SELECT Pk_JobStruct, Fk_Parent, Title, Name, 0   FROM T_JobStruct   WHERE PK_JobStruct = 1 -- el cheffe  UNION ALL   SELECT sub.Pk_Jobstruct, sub.Fk_Parent, sub.Title, sub.Name, (t.Iteration + 1)   FROM T_JobStruct AS sub, temp AS t   WHERE t.Pk = sub.Fk_Parent ) SELECT * FROM Temp]]></description>
			<content:encoded><![CDATA[<p><a href="http://codehauerei-schwarz.de/wp-content/uploads/2009/11/CTE-Rekursion.txt">CTE Rekursion &#8211; Sample</a><br />
 <br />
<a href="http://codehauerei-schwarz.de/wp-content/uploads/2009/11/rec_result.png"><img class="alignnone size-full wp-image-96" title="rec_result" src="http://codehauerei-schwarz.de/wp-content/uploads/2009/11/rec_result.png" alt="rec_result" width="378" height="205" /></a></p>
<pre class="brush:[sql]">WITH TEMP (Pk, Parent_Pk, Title, Name, Iteration) AS
(
  SELECT Pk_JobStruct, Fk_Parent, Title, Name, 0
  FROM T_JobStruct
  WHERE PK_JobStruct = 1 -- el cheffe

 UNION ALL

  SELECT sub.Pk_Jobstruct, sub.Fk_Parent, sub.Title, sub.Name, (t.Iteration + 1)
  FROM T_JobStruct AS sub, temp AS t
  WHERE t.Pk = sub.Fk_Parent

)

SELECT * FROM Temp</pre>
<p><a href="http://codehauerei-schwarz.de/wp-content/uploads/2009/11/rec_cte_queryresult.png"><img class="alignnone size-full wp-image-101" title="rec_cte_queryresult" src="http://codehauerei-schwarz.de/wp-content/uploads/2009/11/rec_cte_queryresult.png" alt="rec_cte_queryresult" width="359" height="197" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://codehauerei-schwarz.de/2009/11/02/rekursive-sql-queries-common-table-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

