I am trying to delete all records that match a quiz id from the question table and the relationship table. The query works for a select statement, but won't allow the same statement to delete. @quizId is a quiz Id value I pass into my stored procedure. Does anyone know how to delete from both tables using one statement? Is it possible?
DELETE tGeoQuestions as a, tGeoQuizToQuestion as b WHERE b.quizId = @quizId AND a.id = b.questionid
Thanks