store result of select query into procedure variable code example Example: how to store the query result in a variable sql SET @anyVariableName = ( yourQuery);