I'm hoping someone has faced this issue before. I'm getting an "Error converting data type varchar to bigint". When I look at the columns I'm pulling from both tables, the data type within both tables is varchar. the only difference I've found within both tables is one has the columns as NOT NULL, and the other has them as NULL. Here's the code snippet causing the error:
select b.*,wt.[PERNR] fromPernr, wt.[NTLOGIN] fromNTLogin, wt.[ROLE] fromjobfunction, wt2.[PERNR] ToPernr, wt2.[NTLOGIN] ToNTLogin, wt2.[ROLE] ToRole
from #tmp3o b inner join [ExternalUser].[iCoMP].[t_WSTCBSTransactionData] wt(nolock)
on b.fromresacctno = wt.[ACCOUNT_NUMBER]
inner join [ExternalUser].[iCoMP].[t_WSTCBSTransactionData] wt2(nolock)
on b.toresacctno = wt2.[ACCOUNT_NUMBER]
select * from #tmp4o
Thank you very much for any and all help!