<?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: Paging in MSSQL 2005-Greater? Help</title>
	<atom:link href="http://www.luismajano.com/2009/02/19/Paging-in-MSSQL-2005Greater-Help/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.luismajano.com/2009/02/19/Paging-in-MSSQL-2005Greater-Help/</link>
	<description>Computer Engineer</description>
	<lastBuildDate>Mon, 31 Dec 2012 17:57:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4</generator>
	<item>
		<title>By: Al</title>
		<link>http://www.luismajano.com/2009/02/19/Paging-in-MSSQL-2005Greater-Help/comment-page-1/#comment-665</link>
		<dc:creator>Al</dc:creator>
		<pubDate>Thu, 19 Feb 2009 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.luismajano.com/#comment-665</guid>
		<description>You might check out this tech article in MSDN which provides 3 different solutions for paging in MS SQL 2000.

http://msdn.microsoft.com/en-us/library/ms979197.aspx</description>
		<content:encoded><![CDATA[<p>You might check out this tech article in MSDN which provides 3 different solutions for paging in MS SQL 2000.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms979197.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms979197.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Short</title>
		<link>http://www.luismajano.com/2009/02/19/Paging-in-MSSQL-2005Greater-Help/comment-page-1/#comment-666</link>
		<dc:creator>Daniel Short</dc:creator>
		<pubDate>Thu, 19 Feb 2009 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.luismajano.com/#comment-666</guid>
		<description>I generally do this with a common table expression:

WITH tempTable AS (
	SELECT
		P.FirstName
		, P.LastName
       	, ROW_NUMBER() OVER(ORDER BY P.LastName, P.FirstName) AS RowNumber
	FROM
		People P (NOLOCK)
	WHERE
		P.Active = 1
)

SELECT *, (SELECT Max(RowNumber) FROM tempTable) AS Records
FROM tempTable
WHERE
	RowNumber &gt;= 11
	AND RowNumber 20
ORDER BY
	LastName, FirstName



CTEs are your friend...</description>
		<content:encoded><![CDATA[<p>I generally do this with a common table expression:</p>
<p>WITH tempTable AS (<br />
	SELECT<br />
		P.FirstName<br />
		, P.LastName<br />
       	, ROW_NUMBER() OVER(ORDER BY P.LastName, P.FirstName) AS RowNumber<br />
	FROM<br />
		People P (NOLOCK)<br />
	WHERE<br />
		P.Active = 1<br />
)</p>
<p>SELECT *, (SELECT Max(RowNumber) FROM tempTable) AS Records<br />
FROM tempTable<br />
WHERE<br />
	RowNumber &gt;= 11<br />
	AND RowNumber 20<br />
ORDER BY<br />
	LastName, FirstName</p>
<p>CTEs are your friend&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
