"Operation Must use a updatable query" message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Trying to run:

UPDATE tblActivityQuestions AS A SET A.QuestionID = (SELECT Q.ID FROM
tblQuestions As Q WHERE A.ChecklistID = Q.ChecklistID AND A.Sequence =
Q.Sequence);

Why this message? A.QuestionID is not defined in a relationship.
 
Would the A.CheckListID be the issue because the alias 'A' is not defined
within the Select query?

In other words, this line: WHERE A.ChecklistID
Does it scope to the alias in Update?
 
Why this message? A.QuestionID is not defined in a relationship.

Try using a Join rather than a subquery:

UPDATE tblActivityQuestions AS A INNER JOIN tblQuestions AS Q
ON A.ChecklistID = Q.ChecklistID
AND A.Sequense = Q.Sequence
SET A.QuestionID = Q.ID;

You will need a unique Index on the combination of ChecklistID and
Sequence.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top