|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
auto increment
Hi,
I am inserting records into SQL db using ASP VBScript. I want to take the id number if the last reccord add 1 to it and insert the new record with the new id number. if someone can tell me just how to query only the last record, I can figure out the rest. Thanks, Krs |
|
#2
|
||||
|
||||
|
Easiest way to do it would be to make the ID field an Identity data type, similar to Access Autonumber. It will automatically increment when a new record is added.
|
|
#3
|
||||
|
||||
|
Quote:
Thanks, What I ended up doing is querying the DB with the MAX(id) as ID and adding 1 to the field to create the next number. I am creating the DB through the web since I do not have access to the machine the DB is actually on. This is a very new experience to me so I am having some trouble, but getting through it. BTW, love the name. It was my email name in College. I am in the middle of reading merrick now. Krs |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > auto increment |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|