Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update table

Status
Not open for further replies.

wutang26

Technical User
May 18, 2006
9
US
I'm trying to update a table from another table.

here is my code
I get an error saying

Incorrect syntax nera the keyword 'INNER'

any suggestion would be appreciated

UPDATE eval_master INNER JOIN dbo_AS_STUDENT_REGISTRATION_DETAIL ON (eval_master.PIDM = dbo_AS_STUDENT_REGISTRATION_DETAIL.PIDM_KEY) AND (eval_master.TERM = dbo_AS_STUDENT_REGISTRATION_DETAIL.TERM_CODE_KEY) AND (eval_master.CRN = dbo_AS_STUDENT_REGISTRATION_DETAIL.CRN_KEY) SET eval_master.[LAST] = dbo_AS_STUDENT_REGISTRATION_DETAIL.LAST_NAME, eval_master.CRN = dbo_AS_STUDENT_REGISTRATION_DETAIL.CRN_KEY, eval_master.DEGC_DESC = dbo_AS_STUDENT_REGISTRATION_DETAIL.DEGC_DESC, eval_master.MAJR_DESC1 = dbo_AS_STUDENT_REGISTRATION_DETAIL.MAJR_DESC1, eval_master.ASTD_CODE_END_OF_TERM = dbo_AS_STUDENT_REGISTRATION_DETAIL.ASTD_CODE_END_OF_TERM, eval_master.ASTD_DESC_END_OF_TERM = dbo_AS_STUDENT_REGISTRATION_DETAIL.ASTD_DESC_END_OF_TERM, eval_master.ASTD_DATE_END_OF_TERM = dbo_AS_STUDENT_REGISTRATION_DETAIL.ASTD_DATE_END_OF_TERM, eval_master.SUBJ_CODE = dbo_AS_STUDENT_REGISTRATION_DETAIL.SUBJ_CODE, eval_master.COURSE_NUMBER = dbo_AS_STUDENT_REGISTRATION_DETAIL.COURSE_NUMBER, eval_master.SUBJ_DESC = dbo_AS_STUDENT_REGISTRATION_DETAIL.SUBJ_DESC, eval_master.COURSE_TITLE = dbo_AS_STUDENT_REGISTRATION_DETAIL.COURSE_TITLE, eval_master.RSTS_CODE = dbo_AS_STUDENT_REGISTRATION_DETAIL.RSTS_CODE, eval_master.SECTION_NUMBER = dbo_AS_STUDENT_REGISTRATION_DETAIL.SECTION_NUMBER, eval_master.RSTS_DESC = dbo_AS_STUDENT_REGISTRATION_DETAIL.RSTS_DESC, eval_master.INSTRUCTOR_FIRST_NAME = dbo_AS_STUDENT_REGISTRATION_DETAIL.INSTRUCTOR_FIRST_NAME, eval_master.INSTRUCTOR_LAST_NAME = dbo_AS_STUDENT_REGISTRATION_DETAIL.INSTRUCTOR_LAST_NAME;
 
Try this...
Code:
UPDATE eval_master 
SET [LAST] = dbo_AS_STUDENT_REGISTRATION_DETAIL.LAST_NAME, 
CRN = dbo_AS_STUDENT_REGISTRATION_DETAIL.CRN_KEY, 
DEGC_DESC = dbo_AS_STUDENT_REGISTRATION_DETAIL.DEGC_DESC, 
MAJR_DESC1 = dbo_AS_STUDENT_REGISTRATION_DETAIL.MAJR_DESC1, 
ASTD_CODE_END_OF_TERM = dbo_AS_STUDENT_REGISTRATION_DETAIL.ASTD_CODE_END_OF_TERM, 
ASTD_DESC_END_OF_TERM = dbo_AS_STUDENT_REGISTRATION_DETAIL.ASTD_DESC_END_OF_TERM, 
ASTD_DATE_END_OF_TERM = dbo_AS_STUDENT_REGISTRATION_DETAIL.ASTD_DATE_END_OF_TERM, 
SUBJ_CODE = dbo_AS_STUDENT_REGISTRATION_DETAIL.SUBJ_CODE, 
COURSE_NUMBER = dbo_AS_STUDENT_REGISTRATION_DETAIL.COURSE_NUMBER, 
SUBJ_DESC = dbo_AS_STUDENT_REGISTRATION_DETAIL.SUBJ_DESC, 
COURSE_TITLE = dbo_AS_STUDENT_REGISTRATION_DETAIL.COURSE_TITLE, 
RSTS_CODE = dbo_AS_STUDENT_REGISTRATION_DETAIL.RSTS_CODE, 
SECTION_NUMBER = dbo_AS_STUDENT_REGISTRATION_DETAIL.SECTION_NUMBER, 
RSTS_DESC = dbo_AS_STUDENT_REGISTRATION_DETAIL.RSTS_DESC, 
INSTRUCTOR_FIRST_NAME = dbo_AS_STUDENT_REGISTRATION_DETAIL.INSTRUCTOR_FIRST_NAME, 
INSTRUCTOR_LAST_NAME = dbo_AS_STUDENT_REGISTRATION_DETAIL.INSTRUCTOR_LAST_NAME
FROM Eval_master em
INNER JOIN dbo_AS_STUDENT_REGISTRATION_DETAIL 
ON (em.PIDM = dbo_AS_STUDENT_REGISTRATION_DETAIL.PIDM_KEY) 
AND (em.TERM = dbo_AS_STUDENT_REGISTRATION_DETAIL.TERM_CODE_KEY) 
AND (em.CRN = dbo_AS_STUDENT_REGISTRATION_DETAIL.CRN_KEY)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top