title: SQL - Stored Proc to Update table from Table Variable
body: <p>I have a stored procedure which inserts records into a table using values from my table variable. (The table variable is sent to SQL from ASP.NET) It works perfect and looks like this...</p>
  
  <pre><code>CREATE PROCEDURE sp_SaveResponses 
  (
  @TableVariable SaveResponsesTableType READONLY
  )
  AS
  BEGIN
  INSERT INTO tbl_Responses
  (
  assessmentid, questionid, answerid
  )
  SELECT assessmentid, questionid, answerid
  FROM @TableVariable
  END
  </code></pre>
  
  <p>The above inserts one record into tbl_Responses for every row in @TableVariable. </p>
  
  <p><strong>The Problem</strong>
  Instead of INSERT, I would like to perform an UPDATE, but I can't get the syntax right.</p>
  
  <p>Thanks for any help...!</p>
  
  <p><strong>UPDATE</strong>
  With some helpful hints, I was able to resolve this below...</p>