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

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

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

  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 ...
bethamsettyAuthor Commented:
   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
       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...

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.