Connecting Tech Pros Worldwide Forums | Help | Site Map

Update Record in two Table using trigger

ranjana1980's Avatar
Newbie
 
Join Date: Jul 2008
Posts: 15
#1: Jul 11 '08
Hi All,
I have two tables One is Student And another is AcademicQualification.In first table RegNo is primary key and in second one it is foreign key then how to create trigger to update table where Student.RegNo = AcademicQualification.RegNo
amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#2: Jul 11 '08

re: Update Record in two Table using trigger


Why you need a trigger to update the values in the tables....a simple update statement will suffice
ranjana1980's Avatar
Newbie
 
Join Date: Jul 2008
Posts: 15
#3: Jul 11 '08

re: Update Record in two Table using trigger


Quote:

Originally Posted by amitpatel66

Why you need a trigger to update the values in the tables....a simple update statement will suffice

simple update statement using two tables not work .

update Student as s,AcademicQualification as a set s.FName='Maya',s.LName='Sharma',a.InstituteNm='St Joseph',a.University='Barkatullah' where s.RegNo==a.Regno
Reply