Unfortunately, compile time has no way of knowing what SQL code will return. Even if we wrote a somewhat intelligent parser that can introspect the database schema (as I have several times), there is still the possibility that the schema will evolve while the previously valid code is deployed, which brings back to the original question.