Fixed sql usage.