I cannot copy SID to my master table with the relationship matching the copies while student id and academic year are equal in each table. After I ran my code, the SID field in master table was still NULL but I got a return message said that there are rows affected. Anyone knows what is wrong with my code?
Here is my copying function code:
ALTER TABLE coursework1.mastertable
ADD SID int;
insert into
coursework1.mastertable(SID)
SELECT distinct
student.SID
FROM
coursework1.student
inner join
coursework1.mastertable on student.StudentID = mastertable.StudentID AND student.Academic_Year = mastertable.Academic_Year;