• Dang! You stole my thunder... I thought up a similar question about a week ago, just didn't get around to submitting it yet...

    Thanks! 😉

    angeloc (1/16/2013)


    well that's interesting. Certainly wouldn't want to rely on it, unless that is behavior in the standard.

    Yes, this is standard. And yet, I still would not rely on it. Imagine how your query would suddenly fail if someone adds a column "col1" to table "TblA2"!

    For any query that uses more than a single table, you should always use the table prefix on ALL column references. (And because most table names tend to be long and I prefer my query to be human readable, this automatically implies that you should also always provide an alias for each of the tables used in the query.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/