November 6, 2008 at 11:56 am
What I've I done wrong with this:
update crt_student_test2
set crt_student_test2.class_id = cactus.cactus, set crt_student_test2.ClassID_Updt = 'Y'
where cactus.teacher = crt_student_test2.class_id
and crt_student_test2.school_year = 2008
and crt_student_test2.school_number = cactus.sch
The data types match but I'm getting:
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'set'.
November 6, 2008 at 12:02 pm
Don't use two sets...
update crt_student_test2
set crt_student_test2.class_id = cactus.cactus,
crt_student_test2.ClassID_Updt = 'Y'
where cactus.teacher = crt_student_test2.class_id
and crt_student_test2.school_year = 2008
and crt_student_test2.school_number = cactus.sch
You may also need a from clause and joins depending on your needs.
November 6, 2008 at 12:06 pm
D'OH! I hope that was a result of my cold medicine and not a serious brain problem. Works just fine. Thanks.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply