Forums
This topic is locked
Need the auto number value
Posted 29 May 2003 18:38:22
1
has voted
29 May 2003 18:38:22 Rammy Nasser posted:
To get an order ID for my cart I randomly create one and insert it into the order table and also to all the items in the basket for that order. This is to link all the items in the basket table to a new order ID.Instead of making a random number can I not take the value of the order_id, an autonumber which is generated when I carry out the insert and somehow update all items in the basket table with this number?
Replies
Replied 29 May 2003 19:22:56
29 May 2003 19:22:56 Jonathan Danylko replied:
After the Insert, use this statement:
SELECT @@IDENTITY
This will return the field's next identity.
L8R,
Vitoman, M CIW D, MMCP
----------------------------------
He conquers who endures. - Persius
SELECT @@IDENTITY
This will return the field's next identity.
L8R,
Vitoman, M CIW D, MMCP
----------------------------------
He conquers who endures. - Persius
Replied 29 May 2003 19:42:16
29 May 2003 19:42:16 Owen Eastwick replied:
Here you go:
Access: www.drdev.net/article06.htm
SQL Server: www.drdev.net/article08.htm
Regards
Owen.
-------------------------------------------------------------------------------------------
Used programming books and web development software for sale (UK only): www.tdsf.co.uk/tdsfdemo/Shop.htm
Developer services and tutorials: www.drdev.net
Multiple Parameter UD4 / Access 2000 Search Tutorial: www.tdsf.co.uk/tdsfdemo/
Access: www.drdev.net/article06.htm
SQL Server: www.drdev.net/article08.htm
Regards
Owen.
-------------------------------------------------------------------------------------------
Used programming books and web development software for sale (UK only): www.tdsf.co.uk/tdsfdemo/Shop.htm
Developer services and tutorials: www.drdev.net
Multiple Parameter UD4 / Access 2000 Search Tutorial: www.tdsf.co.uk/tdsfdemo/