I have created a UDF in SQL server 2005 that returns a table.
I need to pass a parameter to this UDF.
If I use this syntax, it is working as expected:
SELECT * FROM dbo.fnGetAdresseCorrespondance(8914)
But if I use this same UDF in a JOINed query and I pass a field from my first table like this:
select top 10 *
from Technicien AS T
left join dbo.fnGetAdresseCorrespondance(t.IdTechnicien) as Adr
on adr.IdTechnicien = t.IdTechnicien
The error I receive is :
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "t.IdTechnicien" could not be bound.
Any ideas?
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com