Home All Groups Group Topic Archive Search About

Writing SQL: query builder or through the query analyzer?

Author
20 Jul 2006 10:14 PM
VMI
How do you guys prefer to write queries, by hand or by using the query
builder? I'm used to writing it by hand, but a co-worker loves the query
builder(he even hides the sql part). Should I just switch to query builder?
Personally, I don't like it (it looks too much like the MS Access utility)
and I feel that the query it returns is hard to read and maintain.

What do you think?

Thanks.

Author
20 Jul 2006 10:25 PM
Arnie Rowland
My preference is 'hand tooled', just like my preference for clothes, cars,
food. The mass produced ones are just not quite right.

That said, the query builder is a great tool to use to learn how to write
queries -especially multi-table complex joins with convoluted criteria.

THEN, take that generated query, and format it for readability and code
maintenance. When Intellisense and 'smart' formatting comes to query
writing -it will be great.

--
Arnie Rowland
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous


Show quote
"VMI" <V**@discussions.microsoft.com> wrote in message
news:994E32B5-75AF-4F28-9F11-2AEF47BB19CD@microsoft.com...
> How do you guys prefer to write queries, by hand or by using the query
> builder? I'm used to writing it by hand, but a co-worker loves the query
> builder(he even hides the sql part). Should I just switch to query
> builder?
> Personally, I don't like it (it looks too much like the MS Access utility)
> and I feel that the query it returns is hard to read and maintain.
>
> What do you think?
>
> Thanks.
Author
21 Jul 2006 6:49 AM
Damien
Arnie Rowland wrote:
> My preference is 'hand tooled', just like my preference for clothes, cars,
> food. The mass produced ones are just not quite right.
>
> That said, the query builder is a great tool to use to learn how to write
> queries -especially multi-table complex joins with convoluted criteria.
>
> THEN, take that generated query, and format it for readability and code
> maintenance. When Intellisense and 'smart' formatting comes to query
> writing -it will be great.
>
The problem for Intellisense (at least, the fully automatic one I'm
used to in, say, Visual Basic.NET), is the order of a typical select.
You type "select" and hit the spacebar. In other languages, up pops the
Intellisense window with what is available. But what should
Intellisense for SQL pop up? It doesn't know what tables are involved
yet. Given that the from clause may have subqueries with aliased
columns, or refernce other databases, either on the same server or on
other servers, the possible entries in the Intellisense window are
infinite, which makes it less than usable, IMHO.

I've seen, for instance, Red Gate's Intellisense add-on, and tried to
use it. But I found it made my query writing take longer - I don't find
it natural to have to press a key combination to bring up the
Intellisense window, and it tends to produce the same awkwardly named
columns as the querybuilder (I don't want to see owner.table.column for
every column in the select list. I want to have alias.column,
especially when it turns out that my from clause includes the same
table twice)

All very subjective though (and I'm writing this on the morning of my
going away on holiday, so I won't be able to read any replies for at
least a week :-D)

Damien
Author
21 Jul 2006 1:17 PM
Tracy McKibben
VMI wrote:
> How do you guys prefer to write queries, by hand or by using the query
> builder? I'm used to writing it by hand, but a co-worker loves the query
> builder(he even hides the sql part). Should I just switch to query builder?
> Personally, I don't like it (it looks too much like the MS Access utility)
> and I feel that the query it returns is hard to read and maintain.
>
> What do you think?
>
> Thanks.

Absolutely by hand...  Everything I write, I write by hand - SQL, HTML,
ASP, PHP, doesn't matter...  I learned to despise code generators years
ago (ever try to debug an ASP site that got mangled by Frontpage 98?).
Maybe I'm biased, but I don't like point-and-click development.  If a
"developer" can't WRITE code in the language he/she is developing in,
they will never be able to debug something they've built using one of
these tools.

--
Tracy McKibben
MCDBA
http://www.realsqlguy.com

AddThis Social Bookmark Button