Handle sql event aswell