Fix bug for other SQL db