It depends on what the rest of the error message actually said. It could have referred to SQL connection failed, which usually indicates hitting some server limit or an overloaded server, or it could have been an actualy SQL syntax error, which would indicate broken or invalid code (or broken database tables).
Either case needs to be investigated further in the error logs.