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?
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)