UPDATE Std_Marks set SchoolID=t.schoolid from Students t,Std_Marks s where t.ID=s.StudentID UPDATE Std_Marks set ClassID=t.ClassID from Students t,Std_Marks s where t.ID=s.StudentID UPDATE Std_Marks set SectionID=t.SectionID from Students t,Std_Marks s where t.ID=s.StudentID UPDATE Std_Marks SET includedInAvg=t.includedInAvg FROM Section_Subject t,Std_Marks s WHERE t.SchoolID=s.SchoolID and t.ClassID=s.ClassID and t.SectionID=s.SectionID and t.SubjectId=s.SubjectID