I work on SQL server 2012 I face issue I can't join cross apply function with join table GlobalPartNumberPortions to
check portionkey and groupid exist on table GlobalPartNumberPortions
here is my statement
update r set r.Status='Portion Exist Before'
from #TempImporter r
cross apply
dbo.Split(r.GlobalPartNumber,'$') f where CAST (r.PortionNumber AS INT) = f.Id and r.PortionKey = f.Data
I need to add to statement above another check to portionkey and groupid on table GlobalPartNumberPortions
but I don't know how to join with function
by any way are this syntax below possible and correct or not
inner join GlobalPartNumberPortions g on t.PortionNumber=g.GroupId and t.PortionKey=G.PortionKey
join function with table full code as below correct or not
update r set r.Status='Portion Exist Before'
from #TempImporter r
cross apply
dbo.Split(r.GlobalPartNumber,'$') f where CAST (r.PortionNumber AS INT) = f.Id and r.PortionKey = f.Data
inner join GlobalPartNumberPortions g on t.PortionNumber=g.GroupId and t.PortionKey=G.PortionKey