You are here: Re: Referencing colum names in recordset which is created by join - URGENT! « MsSQL Server « IT news, forums, messages
Re: Referencing colum names in recordset which is created by join - URGENT!

Posted by Martijn Tonies on 07/30/06 22:02

> I do know all this of course, I was just surprised by the difference in
> behavior between MS Sqlserver and other database, which return the
> table name as part of the name.
>
> I have read quite a lot on the subject and some people claim that a
> colum name should be UNIQUE in a database, i.e. rather than having
>
> table1.column
> table2.column
>
> the design should be
>
> table1.colum1
> table2.colum2
>
> This would solve ANY ambiguity as to colum names especially in joins.
>
> What is your opinion on that?
>
> P.S. Classis DB / SQL literature does not mention this as a
> prerequisite for proper DB design.

Name the columns as they make sense.

Now, for a proper _resultset_ -- name the columns accordingly.

eg:

select table1.column as table1_column,
table2.column as table2_column
from ... join ... etc. etc ...

Problem solved.


--
Martijn Tonies
Database Workbench - development tool for MS SQL, and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com

 

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

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