• Steve, thanks for the great article, it will create a lot of discussion. Here's my 2c worth.

    All of these rules are GREAT if you use a text editor environment. But not so great if you use GUI. I personally always use GUI where possible. I am not able to understand a 50 line long SQL statement with joins on 10 tables without being able to see it graphically. Where these formatting ideas fall down in a GUI enviroment are:

    As soon as you view the code in A GUI enviromnent all your formatting disappears.

    Tabs don't appear the same way in text and GUI enviromnent so what looks great and all lined up in query analyzer is an undreadable mess in Access.

    You don't need aliases when you create a query in a GUI environment, because it fully qualifies the names for you automatically, and I personally find it harder to read aliases than fully qualified names.

    Basically the point is, unless your whole team now and in the future is going to use exclusively text editors, then you need to be flexible with a coding standard like this, because to re-format a large query created in a GUI enviroment just becuase the people who love to type can't read it, is a waste of time.

    The Answer? I beleive the answer lies in an automatic formatter - does anyone know of one? QUEST software has a fantastic tool for Oracle called Formatter Plus. I've asked them if they're doing one for SQL but they said not at this stage. Maybe if everyone can send them an email, they might get something happening.