Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

SQL Server 2000: sequential number

Avatar of ralph_rea
ralph_rea asked on
Microsoft SQL ServerMicrosoft SQL Server 2005SSRS
12 Comments1 Solution425 ViewsLast Modified:
I've a SQL Server query like this:

select a.id, a.desc_id, b.id_num
from tab_a a, tab_b b
where a.id=b.id

I need add a row number at this query, that returns the sequential number of a row starting at 1 for the first row.

In SQL Server 2005 I know that exists ROW_NUMBER function but I need a similar function in SQL Server 2000.

How Can I add a sequential number (like identity) in my query?

Thanks in advance!
Avatar of Sharath S
Sharath SFlag of United States of America imageData Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answers