0

I have the next sentence:

SELECT E.Nombre,GN3Pruebas.dbo.Empleado.DirectorioActivo
FROM Intranet.dbo.Empleado E
INNER JOIN GN3Pruebas.dbo.Empleado ON GN3Pruebas.dbo.Empleado.CodigoGN2=Intranet.dbo.Empleado.IdEmpleado
and GN3Pruebas.dbo.Empleado.IdEmpleado=5075

And I have the next mistake:

Mens. 4104, Level 16, State 1, Line 4 The multi-part identifier "Intranet.dbo.Empleado.IdEmpleado" could not be bound. Why?. Thanks so much

zoit
  • 617
  • 2
  • 20
  • 41
  • This cannnot be done. Possible suplicate of [this SO question](http://stackoverflow.com/questions/5145637/querying-data-by-joining-two-tables-in-two-database-on-different-servers) – AliK Aug 24 '13 at 15:34

1 Answers1

0

Since you are using an Alias E for Intranet.dbo.Empleado you will have to use the alias for your join condition

SELECT E.Nombre,GN3Pruebas.dbo.Empleado.DirectorioActivo
FROM Intranet.dbo.Empleado E
INNER JOIN GN3Pruebas.dbo.Empleado ON GN3Pruebas.dbo.Empleado.CodigoGN2=E.IdEmpleado
and GN3Pruebas.dbo.Empleado.IdEmpleado=5075
bummi
  • 27,123
  • 14
  • 62
  • 101