Hi All,
Can you please help me build a query which helps me select data from tables existing in different databases .
1) On the same server and same instance.
2) On the same server and different Instances.
3) On different servers.
I tried this query which returns an error.
SELECT T1.*,T2.* FROM TEST.EMPLOYEE T1 JOIN PAYMENT.dbo.TEST.EMPLOYEE T2 ON T1.EMPNUM = T2.EMPNUM
SQL0108N The name "EMPLOYEE" has the wrong number of qualifiers.
SQLSTATE=42601
SQL0108N The name "EMPLOYEE " has the wrong number of qualifiers.
Explanation:
The name "<name>" is improperly qualified.
The object given the name "<name>" can only have one
qualifier.
A column name is qualified with a table name, which is either
qualified or unqualified, or a correlation name. In some
contexts, a column name requires a table name qualifier.
The statement cannot be processed.
User Response:
Ensure that the name for the object is qualified correctly.
sqlcode : -108
sqlstate : 42601
What is the information I need to add for dbo in PAYMENT.dbo.TEST.EMPLOYEE ?
Thanks in Advance,
Venkat,