Ver originalDELIMITER |CREATE PROCEDURE prueba () BEGIN SET @total_reg=0; SELECT COUNT(*) FROM mi_tabla INTO @total_reg; SELECT @total_reg; END|DELIMITER ;