I'm petty new, well very new if truth be told, to SQL Server and need some help passing a parameter in a query that's made of two tables and a parametized UDF
This is what I have:
Tblref is a atable
TblAllo is a Table
GETSelectedSite is parametrized UDF where the patameter name is @SelSite
I can run the UDF OK by itself and the above works if I explicity include the parameter @SelSite eg.
However, that defeats the purpose of a variable so any guidance or help would be very much appreciated.
Many Thanks
SmallTime
This is what I have:
Code:
select *
from
TblRef AS r
inner join TblAllo AS a
ON r.refCN = a.alloCN inner join GETSelectedSite(@SelSite) AS ss
ON r.refCN = ss.refCN
Tblref is a atable
TblAllo is a Table
GETSelectedSite is parametrized UDF where the patameter name is @SelSite
I can run the UDF OK by itself and the above works if I explicity include the parameter @SelSite eg.
Code:
select *
from
TblRef AS r
inner join TblAllo AS a
ON r.refCN = a.alloCN inner join GETSelectedSite('SiteA') AS ss
ON r.refCN = ss.refCN
However, that defeats the purpose of a variable so any guidance or help would be very much appreciated.
Many Thanks
SmallTime