Paolo Valladolid
|
Posted: 05/17/2004, 5:35 PM |
|
I am inserting a row into a table that generates a new sequence number (let's say - EmployeeID). How are other users getting that new EmployeeID? Are you guys just selecting it using the firstname and lastname of the employee?
The DB I am using is SQL Server if that helps. And the Project Language is ASP 3.0 W/ Tempates
|
|
|
peterr
Posts: 5971
|
Posted: 05/17/2004, 6:14 PM |
|
The SQL Server has the "@@IDENTITY" feature that allows to retrieve the last insterted key (autonumeric field).
Please see the related topic at http://forums.codecharge.com/posts.php?post_id=46776
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
David Harrison
|
Posted: 05/17/2004, 7:37 PM |
|
Actually while your at it look at Scope_Identity() this will return the
identity field even if you have triggers that create new entries.
David Harrison
"peterr" <peterr@forum.codecharge> wrote in message
news:240a963732f1bb@news.codecharge.com...
> The SQL Server has the "@@IDENTITY" feature that allows to retrieve the
last
> insterted key (autonumeric field).
> Please see the related topic at
> http://forums.codecharge.com/posts.php?post_id=46776
> _________________
> Peter R.
> YesSoftware Support Representative
> http://support.codecharge.com
> Warning: I use Google
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|