Mensaje
 
a
Todos
General information
Foro:
Microsoft SQL Server
Category:
Sintáxis SQL
Título:
Parameters to a table-type UDF
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
ID de la conversación:
01171783
ID del mensaje:
01171783
Views:
41
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
Next
Responder
Mapa
Ver