I need to create a new employee in the database and needs to use the Autogenerated EmployeeID.
Can’t find the way the procedure needs to be written and use the autogenerated value in my c# code.
Please help me out
Thanks
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.
The SCOPE_IDENTITY() function returns the most recently created Identity value in the current SQL execution scope, and is the recommended way to find the ID in a stored procedure that just did an INSERT.
You can return the value from your stored procedure to you C# client either 1) as a dataset by using SELECT (as above), or, 2) as the RETURN value from you stored procedure, or 3) by passing it back through an OUTPUT parameter declared in you stored procedure.