我在这个存储过程中遇到错误:
ALTER PROCEDURE [dbo].[spc_InsertSubjectToContentRelation]
(
@pCourseGUID NVARCHAR(MAX),
@pAssessmentIds NVARCHAR(MAX),
@pSubjectId NVARCHAR(MAX),
@pVideoIds NVARCHAR(MAX)
)
AS
BEGIN
SET NOCOUNT ON;
IF EXISTS (SELECT * FROM SubjectToAssessmentAndVideoRelation WHERE SubjectId = @pSubjectId AND CourseGuid = @pCourseGuid)
UPDATE SubjectToAssessmentAndVideoRelation SET (AssociatedAssessments = @pAssessmentIds, AssociatedVideos = @pVideoIds) WHERE SubjectId = @pSubjectId AND CourseGuid = @pCourseGuid
ELSE
INSERT INTO SubjectToAssessmentAndVideoRelation VALUES (@pCourseGUID, @pAssessmentIds, @pSubjectId, @pVideoIds)
END
错误是:
过程 spc_InsertSubjectToContentRelation,第 14 行
'(' 附近的语法不正确。
这个查询有什么问题?
编辑:
EXISTS
我在发布代码时忘记添加。我的实际代码是存在的。我收到了存在的错误