Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Rownumber generation ... ?

Author  Topic 

mahesh_bote
Constraint Violating Yak Guru

298 Posts

Posted - 2006-04-21 : 05:13:01
I have one question for u. Can you tell me, how to generate serial number in sql query (SQL Server) (like in Oracle, ROWNUM is there, which returns the rownumber. Similarly to this, does SQL server have any function, etc, which will return the row numbers?

Thanks in advance,


BMahesh

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-21 : 05:30:49
No. there isn't such function but there is workaround. See here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=6195



KH


Go to Top of Page

mahesh_bote
Constraint Violating Yak Guru

298 Posts

Posted - 2006-04-21 : 06:04:04
Thanks again, KH.
Its Working. One more thing, can't we define function in SQL Server which will work like ROWNUM?

BMahesh
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-21 : 06:09:20
Where do you want to show the data?
Use Front end application to number the results

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

mahesh_bote
Constraint Violating Yak Guru

298 Posts

Posted - 2006-04-21 : 06:35:17
I have one recordset, and withing the query, I wants to add one more column as SrNo to generate the serial number.

BMahesh
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-21 : 07:19:02
Did you read my prevoius reply?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -