<?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; Cursor</title>
	<atom:link href="http://codehauerei-schwarz.de/tag/cursor/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>SQL Cursor Template</title>
		<link>http://codehauerei-schwarz.de/2009/11/04/sql-cursor-template/</link>
		<comments>http://codehauerei-schwarz.de/2009/11/04/sql-cursor-template/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 14:14:41 +0000</pubDate>
		<dc:creator>Andreas Schwarz</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Cursor]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://codehauerei-schwarz.de/?p=109</guid>
		<description><![CDATA[DECLARE @lastname varchar(100) DECLARE @firstname varchar(100) DECLARE query_cursor CURSOR FOR SELECT LastName, FirstName FROM T_AddressData ORDER BY PK_AddressData OPEN query_cursor FETCH NEXT FROM query_cursor INTO @lastname, @firstname PRINT '---------- Results ----------' WHILE @@FETCH_STATUS = 0 BEGIN PRINT (@lastname + ' ' + @firstname) FETCH NEXT FROM query_cursor INTO @lastname, @firstname END CLOSE query_cursor DEALLOCATE query_cursor]]></description>
			<content:encoded><![CDATA[<pre class="brush:[sql]">DECLARE @lastname varchar(100)
DECLARE @firstname varchar(100)

DECLARE query_cursor CURSOR FOR

	SELECT
		LastName,
		FirstName
	FROM
		T_AddressData
	ORDER BY
		PK_AddressData

OPEN query_cursor

FETCH NEXT FROM query_cursor
INTO @lastname, @firstname

PRINT '---------- Results ----------'

WHILE @@FETCH_STATUS = 0
BEGIN
	PRINT (@lastname + ' ' + @firstname)

	FETCH NEXT FROM query_cursor
	INTO @lastname, @firstname
END

CLOSE query_cursor
DEALLOCATE query_cursor</pre>
]]></content:encoded>
			<wfw:commentRss>http://codehauerei-schwarz.de/2009/11/04/sql-cursor-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

