You are here: Re: Select command with multiple tables « MsSQL Server « IT news, forums, messages
Re: Select command with multiple tables

Posted by Hugo Kornelis on 02/16/06 21:51

On 15 Feb 2006 20:43:49 -0800, Shwetabh wrote:

>> Why would it be necessary to use SELECT * in such a scenario? SELECT *
>> is slow because it requires extra work by the server to retrieve the
>> column metadata. It's unreliable because more code may break if and
>> when the table structure changes. It's hard to maintain because you
>> can't easily search for column dependencies in your code during
>> development.
(snip)
>
>I understand what you are saying. But consider this scenario:
>A user needs a few more fields in the database and adds them to a table
>kept for the purpose. Now how can _those_ fields be accessed without
>using select *?

Hi Shwetabh,

Easy.

In the parts of the application that have to use the new column, you can
add it to the column list in the SELECT statement at the same time
you're making the change to use the column.

And in the parts of the application that don't have to use the new
column, you don't have to change anything.

--
Hugo Kornelis, SQL Server MVP

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация