
How can I create a stored procedure to update the Std_Course’s column based on the Id and Name parameter, OR inserts a new row if the Id and Name does not exist
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.
Try something like this:
Update: since you’re on SQL Server 2008, you could also use a simple
MERGEstatement – either directly “inline” or inside the stored procedure. It would look something like this: