Please check to make sure your script is working.
Try this:
Select a. * from #A a join #B b on Stuff(a.Ename, charindex('-',Ename),len(a.Ename),'')=b.Ename1
Please check to make sure your script is working.
Try this:
Select a. * from #A a join #B b on Stuff(a.Ename, charindex('-',Ename),len(a.Ename),'')=b.Ename1