View Single Post

   
  #2 (permalink)  
Old 02-29-2008, 01:54 PM
David Portas
 
Posts: n/a
Default Re: SQL Join with unknown tables - but it works!?!

refDROP_VALUES_1 and refDROP_VALUES_2 are referenced first as owner
(schema) names, specifically the owner names of the two tables called
Drop_Value.

Those same names (refDROP_VALUES_1 and refDROP_VALUES_2) are then used
as aliases for another table owned by dbo (dbo.refDROP_VALUES). This is
very confusing naming but is perfectly legal if all the tables exist.
To demonstrate, try:

SELECT TOP 10 * FROM refDROP_VALUES_1.Drop_Value
SELECT TOP 10 * FROM refDROP_VALUES_2.Drop_Value
SELECT TOP 10 * FROM dbo.refDROP_VALUES

Lookup Owner Names in Books Online if you haven't come across two-part
names before.

--
David Portas
SQL Server MVP
--

Reply With Quote