The following warnings occurred:
Warning [2] Cannot modify header information - headers already sent by (output started at D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\inc\scripts.php:2) - Line: 1701 - File: D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\inc\functions.php PHP 5.2.17 (WINNT)
File Line Function
[PHP]   errorHandler->error
D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\inc\functions.php 1701 header
D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\inc\functions.php 1763 my_setcookie
D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\inc\functions_indicators.php 42 my_set_array_cookie
D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\showthread.php 578 mark_thread_read
Warning [2] Cannot modify header information - headers already sent by (output started at D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\inc\scripts.php:2) - Line: 1701 - File: D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\inc\functions.php PHP 5.2.17 (WINNT)
File Line Function
[PHP]   errorHandler->error
D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\inc\functions.php 1701 header
D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\inc\functions.php 1763 my_setcookie
D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\inc\functions_indicators.php 218 my_set_array_cookie
D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\inc\functions_indicators.php 48 mark_forum_read
D:\inetpub\vhosts\visionwebdirectory.com\httpdocs\forum\showthread.php 578 mark_thread_read





Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SQL Server 2005 Paging Method Using CTE
06-30-2013, 06:47 PM
Post: #1
SQL Server 2005 Paging Method Using CTE
DECLARE @StartRow INT

DECLARE @EndRow INT

SET @StartRow = 120;

SET @EndRow = 140;

WITH PersonContact AS

(

SELECT PC.FirstName, PC.LastName, PC.EmailAddress,

ROW_NUMBER() OVER(

ORDER BY PC.FirstName, PC.LastName,PC.ContactID) AS RowNumber

FROM Person.Contact PC)

SELECT FirstName, LastName, EmailAddress

FROM PersonContact

WHERE RowNumber @StartRow

AND RowNumber < @EndRow

ORDER BY FirstName, LastName, EmailAddress
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)