Reputation: 21
I have a problem with the following statement :
SELECT
B.idimpianto,
B.CodiceImpianto,
B.DescrizioneImpianto,
B.CodiceCDC,
B.descrizioneCDC
FROM ITCOWBase.dbo.GetImpiantiUtente(B.idimpianto) AS A
INNER JOIN dbo.vImpianti AS B ON A.idimpianto = B.idimpianto
When I try to execute it, the SQL parser says:
the multipart identifier B.impianto could not be bound.
Upvotes: 0
Views: 592
Reputation: 1269873
You want apply
:
SELECT B.idimpianto, B.CodiceImpianto, B.DescrizioneImpianto,
B.CodiceCDC, B.descrizioneCDC
FROM dbo.vImpianti b cross apply
ITCOWBase.dbo.GetImpiantiUtente(B.idimpianto)
It looks like you are only doing filtering, so you want cross apply
rather than outer apply
.
Upvotes: 1