Wednesday, March 21, 2012

How can i access internal row id of sql server

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.> 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.
>sql

No comments:

Post a Comment