I just want to ask how to get latest inserted ID from table A as an example and use it to enter a record in another table B?
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.
If I got your question well, You need to perform two
INSERTstatements within oneStored Procedureand use the ID generated from the first statement to use it in the second statement, useSCOPE_IDENTITY()SCOPE_IDENTITY (Transact-SQL) – MSDN