November 20, 2001 at 10:31 pm
I want to return the identity for a row that was updated using an update statement.
The update statement is as follows:
UPDATE Answers
SET InUse = @SessionID
FROM (Select Top 1 AnswerID from Answers_Eligible) . . .
I need the asnwerid for the updated record. @@Identity is only useful for inserts.
Any suggestions appreciated.
Thanks in advance
November 21, 2001 at 2:13 am
Could use "select top 1 identitycol from Answers_Eligible" after the update
Paul Ibison
Paul Ibison
Paul.Ibison@replicationanswers.com
November 21, 2001 at 10:34 am
select @somvar = Top 1 AnswerID from Answers_Eligible
Then use this in hte update and return it.
Steve Jones
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy