0
IF NOT EXISTS (SELECT prereqListID
               FROM   dbo.tblPreRequisiteList
               WHERE  NOT prereqListID IN (SELECT FK_prereqID
                                           FROM   dbo.tblPreReqStudentAnswers
                                           WHERE  FK_applicantID = @appID))

I have a syntax error in this statement that I can't seem to identify.

Any thoughts?

Thanks for your time.

4
  • What is actual error? Commented Nov 20, 2013 at 19:57
  • 3
    What follows the IF? Commented Nov 20, 2013 at 19:57
  • Can you please share the entire statement? Commented Nov 20, 2013 at 19:57
  • Also please state RDBMS. For some reason I assumed SQL Server. dbo.tblPreRequisiteList makes that look a reasonable assumption but please clarify. Commented Nov 20, 2013 at 20:09

1 Answer 1

2

Executing the code in the question will give the error

Incorrect syntax near ')'.

You need to follow it with another statement/block

IF NOT EXISTS (SELECT prereqListID
               FROM   dbo.tblPreRequisiteList
               WHERE  NOT prereqListID IN (SELECT FK_prereqID
                                           FROM   dbo.tblPreReqStudentAnswers
                                           WHERE  FK_applicantID = @appID))
BEGIN
SomethingHere:
END        
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.