Fixed sql error when adding provider events.