|
Posted by Greg D. Moore \(Strider\) on 09/14/05 05:32
"Erland Sommarskog" <esquel@sommarskog.se> wrote in message
news:Xns96D057FB844Yazorman@127.0.0.1...
> David Portas (REMOVE_BEFORE_REPLYING_dportas@acm.org) writes:
> > In a production application table column order is mostly unimportant -
>
> Yes, if no humans ever look at the database - which is highly unlikely
> if the system is in production.
>
> I just get so tired of this. Everytime someone asks about placing a column
> in a certain order in a table, there is always someone knowledgable who
> needs to tell that person he does not need to do that.
>
> Column order *does* matter, because it makes it so easy to work with.
> The fact that SQL Server does not provide any simple command to change
> order is no reason to tell people they want the wrong thing.
I can see your point of view (and often wish in EM I could see columns in
the order I want) but to a point have to disagree with it.
Let me pull a Celko here, but I think getting into the mindshift of thinking
of a table and realizing that order of columns should not be a physical
attribute of the table.
The minute folks assume they are, they start accepting code like select *
from bar and assuming that * will return columns in a specific manner. This
burned us on a code change a year or so ago where due to the way the schema
was changing (partly due to replication) the order of the columns DID in
fact change and of course the programmers who wrote the code in the height
of the dotcom era saved 30 seconds (or about 2 days "internet time" :-) by
typing * instead of a proper column list.
This was fine for 3-4 years until suddenly production code on a high volume
website broke.
Ideally Enterprise Manager could access some sort of metadata that would
store the desired view of columns, independent of the physical layout of the
table.
>
> --
> 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
>
[Back to original message]
|