Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I intend to write a procedure in SqlServer that can update the joined tables,in my case i have two tables (HowzeEducation & HowzeDegree) so i have written the following query but it has errors and does not work properly.Here is my code:
SQL
declare  
@HowzeEducationId int, 
@DegreeId int, 
@FieldName nvarchar(50), 
@FinishLevelDate date, 
@Average decimal(4,2), 
@SchoolName nvarchar(50), 
@StudyCityDescribtion nvarchar(100), 
@ThesisTitle nvarchar(200), 
@Describtion nvarchar(600) 
 
 
update ( 
  select he.FieldName, 
     he.Average, 
     he.Describtion, 
     he.FinishLevelDate, 
     he.SchoolName, 
     he.StudyCityDescribtion, 
     he.ThesisTitle, 
     hd.DegreeId 
from HowzeEducation he inner join HowzeDegree hd on  
     he.HowzeEducationId=hd.HowzeEducationId 
   ) 
 set he.FieldName=@FieldName , 
he.Average=@Average, 
he.Describtion=@Describtion, 
he.FinishLevelDate=@FinishLevelDate, 
he.SchoolName=@SchoolName, 
he.StudyCityDescribtion=@StudyCityDescribtion, 
he.ThesisTitle=@ThesisTitle, 
hd.DegreeId=@DegreeId 
 
where he.HowzeEducationId=@HowzeEducationId


How can solve this problem?
Posted
Comments
Tejas Vaishnav 17-Oct-12 4:15am    
what was the error message.?

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900