This CTE query works fine without the linked server fields and the join. The select (commented out below) from the linked server works fine also, separately. When I join them with or without aliases, I get this error on all 4 columns:Msg 4104, Level 16, State 1, Line 8The multi-part identifier "SMSSMNMIRPT011.CM_007._sde.v_HR_NSV.EMPLID" could not be bound.;WITH CTE AS (SELECT lastname,firstname,[email address] email,authstatus,CASE WHEN ISNUMERIC(RIGHT(emplid,len(emplid)-1))=1 THEN dbo.PaddedEmpID(RIGHT(EMPLID,LEN(EMPLID)-1)) ELSE RIGHT(EMPLID,LEN(EMPLID)-1) END EmpID,SMSSMNMIRPT011.CM_007._sde.v_HR_NSV.EMPLID,SMSSMNMIRPT011.CM_007._sde.v_HR_NSV.LAST_NAME,SMSSMNMIRPT011.CM_007._sde.v_HR_NSV.FIRST_NAME,SMSSMNMIRPT011.CM_007._sde.v_HR_NSV.EMAIL_ID FROM XLTEST_SP2...Sheet1$)SELECT lastname,firstname,email,empidFROM CTELEFT JOIN SMSSMNMIRPT011.CM_007._sde.v_HR_NSVON CTE.EmpID = SMSSMNMIRPT011.CM_007._sde.v_HR_NSV.Emplid--select top 1000 * from SMSSMNMIRPT011.CM_007._sde.v_HR_NSV
Thanks for any help with this.Duane