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
 Transact-SQL (2000)
 Idetity in SQL 2000

Author  Topic 

irfanshirur
Starting Member

21 Posts

Posted - 2009-12-22 : 05:50:16

Hi

What is the Equivelent command for Row_Number(SQL 2005) in SQL 2000.

I used the Identity also but we need to store that in temp table, so i dont want to store it in the temp table instead of i want add one more column for my query as row number which will give me incremented number.

Query :
select column1, column2
from Table1

I want one more column at the end which should display the unique number staring from 1.

Finally i want to create a view of this query .

Please can any one help me out to solve this.

thanks
regards
Mohammed Irfan



rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-12-22 : 05:57:58
hi

try this..

SELECT ROWID=IDENTITY(int,1,1) , column1, column2
Into Table2
from Table1 Order by column1


select * from Table2

-------------------------
R...
Go to Top of Page

irfanshirur
Starting Member

21 Posts

Posted - 2009-12-22 : 06:21:55

Thanks for reply.

This will work but it will create in temp table, so there will not be any performaec issue with this ?

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-12-23 : 01:35:35
Where do youi want to show the data?

Madhivanan

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

- Advertisement -