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.
Simulating
ROW_NUMBERin SQL Server 2000