|
Posted by Erland Sommarskog on 09/14/05 00:23
David Portas (REMOVE_BEFORE_REPLYING_dportas@acm.org) writes:
> I agree with most of what you said. What I mean by "mostly unimportant"
> is that for most people most of the time the column order returned by
> SELECT * is not important enough to justify the effort and impact of
> recreating a table. That's my experience anyway.
I would agree that with the current state of the art, that rearranging
columns is a bit too much hassle. Then again, if I were to take over
maintenance were column order were accidental, and particularly different
in different in different instances of the same schema, I might consider
it. (After all, I have the tools to do this rather easily. It is just
the time to run it that could be expensive.)
> I don't agree with this. There is good reason to tell people they are
> wrong. Implied column ordering is a serious failing of SQL and has lead
> to much bad code and incorrect results. I want to discourage anyone
> from building column order dependencies into their systems. I would do
> so even if SQL Server made it a trivial task to re-order columns - in
> fact I'd be even more vocal about it if there were a trivial solution!
> I agree that there is a case for physically ordering columns for
> support and development purposes but I don't want people to confuse
> that service delivery issue with their business's presentational
> requirements.
One should not forget that there actually users out there whose only
application is Open Table in Enterprise Manager. I don't like it myself,
but there was a huge outcry when Microsoft tried to leave it out from
Management Studio in SQL 2005.
Of course, using SELECT * in combination with references to columns by
number in client code is extremely bad practice.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Navigation:
[Reply to this message]
|