How can I get back the autogenerated ID for a new record I just inserted? (Using ASP classic and MSSQL 2005)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Thanks all who suggested SELECT SCOPE_IDENTITY(). I was able to create a stored procedure:
and call the sproc using VB:
I can now use resultID anytime I refer to the newly created ID.