Placing answer from comments:
Quote:Instead of executing dynamic query write a static query with param, change to following
select QID,Marks,Question from QBObjective where CASE WHEN @LevelID = 1 THEN 1SubjectID
WHEN @LevelID=2 THEN 2SubjectID
END = @TopicID
I am sure you have limited number of Level as these are referring columns.