> In your particular example, it is a bad practice to have similar
> column names across tables, especially any that have any chance
> of being joined.

Funny, that's exactly what you need to do when using the NATURAL JOIN[1] SQL
statement :) [2]

I agree, and I never do that, but sometimes you get burned by people not
playing by the rules... our company (not my) practice is to use a
two-letter-prefix system.  So for the Medical Records system, we might have
a table called mr_patients, with a primary id called mrpt_id.  I'm not sure
I like that, but that's the standard.  So when an FK reference is made, it's
mr_visits.mrvs_mrpt_id, which really doesn't roll off the tongue, but it's
safe.

> I prefer SELECT *, because I think the risks in that scenario
> is low, and made lower by proper application of other
> practices.

Feel free to code however you want ;)  We try to adhere to the
recommendations of Dabs on the major SQL sites.

Marc
[1]
http://manuals.sybase.com/onlinebooks/group-aw/awg0800e/dbugen8/@Generic__Bo
okTextView/20273
[2] Not that I recommend that syntax, in-fact it's perilous for exactly the
reason we've discussed

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to