title: sql server query to return a value
body: <p>Below is my query which is updating a record in the User table , I want the query to return the UserId which was updated, How can I do this?</p>
  
  <pre><code>         UPDATE USER
              SET GroupID = @New_GroupID
             FROM USER 
  LEFT OUTER JOIN DOCUMENTS ON User.UserID = Documents.UserID
            WHERE (Documents.UNC = @UNC) 
              AND (User.GroupID = @Old_GroupID)
  </code></pre>