Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autonumbering in update per order

Status
Not open for further replies.

GISql

Programmer
May 23, 2006
12
NO
Hi,

I have orders with unique numbers. These orders have orderlines. How can I do an update query to update all order lines in a table to autonumber all lines from 1 to n?

Background info: I have orderlines. Some have to be summed and combined to one order line. I get these plus others in a temporary table.

This means that I can have order line numbering like 1, 2, 5, 6, 8, 9

Which then should become 1, 2, 3, 4, 5, 6

This has to done for every order no.

Is there an easy way to accomplish this?

Thank you in advance,

G.I.
 
I'm not sure if there is a way to do that in SQL, it sounds kind of dangerous. In access I know you can just delete and re-create the autonumber field.

Why not just send everything (summed lines and any other lines you'd want) to your temporary table and then append everything but ID Number to a third table with clean autonumber field?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top