what is substitution of ROWID and ROWNUM of Oracle in SQLServer

Hi ,
    usually in Oracle people uses ROWID and ROWNUM in Oracle.  I want to know what is the same we can use in SQL Server ?

 help would be appreciated

Regards
Sridhar.B
bethamsettyAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
>but if i want to retrieve a range then what is the option
there is no really good option.

declare @t ( id int , rownumber int identity )

insert into  @t (id ) select top 200 id from yourtable  order by ...

select t.*
from yourtable t
join @t l
  on l.id = t.id
and l.rownumber >= 101

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
ROWID:
  there is NO replacement (btw, ROWID is to be used carefully in Oracle)

ROWNUM:
  SQL Server 2005:
     you have a ROW_NUMBER() function

  SQL Server in general:
     when you want to get only the first x rows:
     SELECT TOP x ... FROM ... WHERE ...
0
 
bethamsettyAuthor Commented:
Hi,
   ROW_NUMBER() can be used for SQL Server 2005 not for 2000.  I want it for 2000 and another thing is TOP x.. is used to retrive top rows but if i want to retrieve a range then what is the option
    ex:
       I want to maintain paging in VB by using SQL Server 2000
         First user will view 100 rows next i want to  bring 100 to 200 rows...

Regards
Sridhar.B
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.