Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Quering using Four Part name gives Error

Author  Topic 

sagitariusmzi
Posting Yak Master

113 Posts

Posted - 2011-03-01 : 06:34:25
Hi,

I have the following query

SELECT * FROM ZAFAR.AdventureWorks.Sales.Customer
INNER JOIN ZAFAR.AdventureWorks.Sales.CustomerAddress
ON ZAFAR.AdventureWorks.Sales.Customer.CustomerID=ZAFAR.AdventureWorks.Sales.CustomerAddress.CustomerID

This Query gives the error
Msg 4104, Level 16, State 1, Line 3
The multi-part identifier "ZAFAR.AdventureWorks.Sales.Customer.CustomerID" could not be bound.
Msg 4104, Level 16, State 1, Line 3
The multi-part identifier "ZAFAR.AdventureWorks.Sales.CustomerAddress.CustomerID" could not be bound.


In this query ZAFAR is the link server.
When i execute the query
SELECT * FROM ZAFAR.AdventureWorks.Sales.Customer
It is executed successfully.

I don't understand what the problem is ?
any help regarding this will be appreciated.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-03-01 : 07:36:43
You should give alias names to the tables and then use the alias names in the ON part.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -