Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8847171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:08:27+00:00 2026-06-14T12:08:27+00:00

How to correct added records to the table with correct order number on SQL

  • 0

How to correct added records to the table with correct order number on SQL Server 2000?

I have the following ordered table:

OrderNo Data
      0    A
      1    B
      2    C

I need to add the following records to the table (with order saving):

OrderNo Data
      2    E
      3    F
      1    D

And to get the following as the result on the table:

OrderNo Data
      0    A
      1    B
      2    C
      3    D
      4    E
      5    F

How to do this on SQL Server 2000?

P.S. OrderNo can’t be identity or unique.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:08:28+00:00Added an answer on June 14, 2026 at 12:08 pm

    Simulating ROW_NUMBER in SQL Server 2000

    select (select count(*) 
            from Table1 as e2
            where e2.OrderNo <= e1.OrderNo) as OrderNo, e1.Data
    from Table1 as e1
    ORDER BY OrderNo
    
    • SQLFiddle Demo
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using linq to sql in my data layer where I have added a
I am displaying a table of data from an sql query and want to
I have added a record to my table which auto-increments the primary key. I
I have a huge table which I need to read through on a certain
I have an Access table that I recently added an attachment field to. The
Correct me If I am doing wrong, I have just started to check WCF
I am struggling understanding what a clustered index in SQL Server 2005 is. I
Ok so I have this storedproc in my SQL 2008 database (works in 2005
I have a table like this <tr> <td>No.</td> <td>Username</td> <td>Password</td> <td>Usage Left</td> <td>%</td> <td>Valid
I have to following sproc: USE [CW] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.