我打算在 SqlServer 中编写一个可以更新连接表的过程,在我的情况下,我有两个表(HowzeEducation 和 HowzeDegree),所以我编写了以下查询,但它有错误并且无法正常工作。这是我的代码:
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
如何解决这个问题?