<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: SQL Server For Each Row Next</title>
	<atom:link href="http://sqlserverplanet.com/tsql/sql-server-for-each-row-next/feed" rel="self" type="application/rss+xml" />
	<link>http://sqlserverplanet.com/tsql/sql-server-for-each-row-next</link>
	<description>Tips and Articles on SQL Server</description>
	<lastBuildDate>Mon, 06 Feb 2012 13:36:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: A Roy Chowdhury</title>
		<link>http://sqlserverplanet.com/tsql/sql-server-for-each-row-next/comment-page-1#comment-1092</link>
		<dc:creator>A Roy Chowdhury</dc:creator>
		<pubDate>Fri, 03 Feb 2012 13:24:53 +0000</pubDate>
		<guid isPermaLink="false">http://sqlserverplanet.com/?p=1451#comment-1092</guid>
		<description>Hi all,
Please suggest me what will be best way to processing 1000000 records  in following logic..

Begin Loop on Master Table
   Posting on Transaction File
   Begin Loop on Detail Table
      Posting on Transaction File   
   Loop
Loop
---------------------------------------------------
Posting Procedure on Transaction File
If record not exits in Transaction File
   Begin
      Insert New Record
   End
Else
  Begin
    Update Same records
  End 

- Regrds
A Roy Chowdhury</description>
		<content:encoded><![CDATA[<p>Hi all,<br />
Please suggest me what will be best way to processing 1000000 records  in following logic..</p>
<p>Begin Loop on Master Table<br />
   Posting on Transaction File<br />
   Begin Loop on Detail Table<br />
      Posting on Transaction File<br />
   Loop<br />
Loop<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Posting Procedure on Transaction File<br />
If record not exits in Transaction File<br />
   Begin<br />
      Insert New Record<br />
   End<br />
Else<br />
  Begin<br />
    Update Same records<br />
  End </p>
<p>- Regrds<br />
A Roy Chowdhury</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://sqlserverplanet.com/tsql/sql-server-for-each-row-next/comment-page-1#comment-1091</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 03 Feb 2012 13:19:14 +0000</pubDate>
		<guid isPermaLink="false">http://sqlserverplanet.com/?p=1451#comment-1091</guid>
		<description>Begin Loop on Master Table
   Begin Loop on Detail Table

Loop</description>
		<content:encoded><![CDATA[<p>Begin Loop on Master Table<br />
   Begin Loop on Detail Table</p>
<p>Loop</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doc</title>
		<link>http://sqlserverplanet.com/tsql/sql-server-for-each-row-next/comment-page-1#comment-1085</link>
		<dc:creator>Doc</dc:creator>
		<pubDate>Mon, 30 Jan 2012 00:43:37 +0000</pubDate>
		<guid isPermaLink="false">http://sqlserverplanet.com/?p=1451#comment-1085</guid>
		<description>Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doc</title>
		<link>http://sqlserverplanet.com/tsql/sql-server-for-each-row-next/comment-page-1#comment-1084</link>
		<dc:creator>Doc</dc:creator>
		<pubDate>Mon, 30 Jan 2012 00:38:08 +0000</pubDate>
		<guid isPermaLink="false">http://sqlserverplanet.com/?p=1451#comment-1084</guid>
		<description>Thanks. Solved my problem!</description>
		<content:encoded><![CDATA[<p>Thanks. Solved my problem!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://sqlserverplanet.com/tsql/sql-server-for-each-row-next/comment-page-1#comment-1012</link>
		<dc:creator>David</dc:creator>
		<pubDate>Thu, 15 Dec 2011 20:20:56 +0000</pubDate>
		<guid isPermaLink="false">http://sqlserverplanet.com/?p=1451#comment-1012</guid>
		<description>Why not:
Declare @field1 varchar(254), @field2 varchar(254)

Declare COUNTER Cursor for
Select field1,field2 from Table
open COUNTER
fetch next from COUNTER into @field1,@field2
while @@fetch_Status != -1
begin

--process code

fetch next from COUNTER into @field1,@field2
end
close COUNTER
Deallocate COUNTER</description>
		<content:encoded><![CDATA[<p>Why not:<br />
Declare @field1 varchar(254), @field2 varchar(254)</p>
<p>Declare COUNTER Cursor for<br />
Select field1,field2 from Table<br />
open COUNTER<br />
fetch next from COUNTER into @field1,@field2<br />
while @@fetch_Status != -1<br />
begin</p>
<p>&#8211;process code</p>
<p>fetch next from COUNTER into @field1,@field2<br />
end<br />
close COUNTER<br />
Deallocate COUNTER</p>
]]></content:encoded>
	</item>
</channel>
</rss>

