CREATE PROCEDURE `spAddQuestionSubmit` ( IN `P_QuestionId` INTEGER , IN `P_IsSubmitted` BIT ) BEGIN IF EXISTS ( SELECT ? FROM `tetestquestions` WHERE `Id` = `P_QuestionId` ) THEN UPDATE `tetestquestions` SET `IsSubmitted` = `P_IsSubmitted` WHERE `Id` = `P_QuestionId` ; SELECT ? AS `Result` ; ELSE SELECT ? AS `Result` ; END IF ; END 