-
best way to retrieve identity after insert
I have multiple processes inserting rows into a table. To ensure row uniqueness I have set a column "userID" as identity and the primary key. I always need to retrieve the newly created "userID" value immediately after the insert. What is the best way to get at this value if no other part of the row is unique?
Immediately after the insert I can use SELECT max(userID) to get this, but what if a different process has inserted another record in the interim?
Thanks in advance. -bigpow
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|