A while ago (around 2004) I worked as a back-end developer on a team where everyone used the where clause joins. As a proponent of using inner/outer joins instead, I showed them an example of a where clause join that illustrated how it could produce ambiguous results depending on data, and how the outer joins were free from that problem.
I have to do the same presentation but cannot find that snippet anymore. It is somewhere in my file archive which I unfortunately do not have access to. Does anyone have an example handy?
Best Answer
This can only be demonstrated on databases set to 80 compatibility level (or SQL Server <= 2000).
Don't want to use a nullable name column to demonstrate? Ok, how about a nullable foreign key column?
Not sure why you need to demonstrate this today - you just simply shouldn't be using
*= / =*
joins at all, regardless of whether you can reproduce some ambiguous behavior - they are deprecated and won't work in any database that doesn't support 80 compatibility level. And if you are using compatibility level 80, you need to be prepared for a ton of other functional differences and potential breaking changes when you do finally upgrade.What is the actual behavior of compatibility level 80?
Bad habits : Clinging to old compatibility levels
Bad habits to kick : Using old-style joins