UPDATE Student SET Student.StudentId = PersonalDetails.StudentId
FROM Student
INNER JOIN PersonalDetails on Student.UserId = PersonalDetails.UserId
Tutorial King
UPDATE Student SET Student.StudentId = PersonalDetails.StudentId
FROM Student
INNER JOIN PersonalDetails on Student.UserId = PersonalDetails.UserId