Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameters to a table-type UDF
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01171783
Message ID:
01171807
Views:
6
I found it. It is a new feature of SQL 2005 and new keywords (CROSS APPLY or OUTER APPLY) have been added.

The syntax looks like this:
select top 10 *
from Technicien AS T
cross apply  dbo.fnGetAdresseCorrespondance(t.IdTechnicien) 
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform