We help IT Professionals succeed at work.

Inner join across an instance

LouisvilleGeek
on
I am currently trying to inner join between two databases.  One of them is a true database, and the other is an instance.  While I can pull records from one without a hitch (they have been linked), when I try to perform the join, I'm told that it cannot find the column in question.  Here's the statement I've been trying:

SELECT equipmentId
FROM [CHSQL01\ABOUTTIME].[abtt].[dbo].[Equipment]
INNER JOIN VPTest.dbo.bEMEM
ON [CHSQL01\ABOUTTIME].[abtt].[dbo].[Equipment].[equipmentCode] = VPTest.dbo.bEMEM.Equipment

Open in new window

And this is the error, I'm receiving:
Msg 4104, Level 16, State 1, Line 4
The multi-part identifier "CHSQL01\ABOUTTIME.abtt.dbo.Equipment.equipmentCode" could not be bound.

Open in new window

Any help is greatly appreciated.  Thanks in advance!
Comment
Watch Question

Sr. System Analyst
CERTIFIED EXPERT
Commented:
use alias

SELECT equipmentId
FROM [CHSQL01\ABOUTTIME].[abtt].[dbo].[Equipment] a
INNER JOIN VPTest.dbo.bEMEM b
ON a.[equipmentCode] = b.Equipment

Author

Commented:
Thanks!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.