Home > Archive > MS SQL Server > December 2006 > How can i access internal row id of sql server









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How can i access internal row id of sql server
khaleek_ahmad@yahoo.com

2006-12-05, 5:16 am

I want to access nth row from a table in sql server without use of
row_number(),rank() and even without top keyword.
May any one help me.
Please mail me the solution at khaleek_ahmad@yahoo.com.

Dan Guzman

2006-12-05, 7:12 pm

> How can i access internal row id of sql server

What makes you think there is an internal row number in SQL? The key point
is a table is by definition an unordered set of rows. Retrieving a row by
ordinal position implies ordering and there are other issues as well. What
is the underlying reason that you need to select individual rows by row
number?

>I want to access nth row from a table in sql server without use of
> row_number(),rank() and even without top keyword.


If you must retrieve data by ordinal position, one method create a server
cursor based on a SELECT...ORDER BY and retrieve individual rows using
FETCH...ABSOLUTE. This can technique can have performance implications with
large tables, though.

--
Hope this helps.

Dan Guzman
SQL Server MVP

<khaleek_ahmad@yahoo.com> wrote in message
news:1165316287.766901.82530@16g2000cwy.googlegroups.com...
>I want to access nth row from a table in sql server without use of
> row_number(),rank() and even without top keyword.
> May any one help me.
> Please mail me the solution at khaleek_ahmad@yahoo.com.
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com