Divide sp_set_params into separate helper functions.