I have this:
SELECT
A
,B
,dbo.Func(C)
,dbo.Func(D)
,dbo.Func(E)
,F
FROM abcdef
WHERE
0 = dbo.Func(C) + dbo.Func(D)
I have read that this is not good practice because the function is called million of times and it has a bad impact on performance.
I tried to rewrite it with CROSS APPLY:
SELECT *
FROM abcdef
CROSS APPLY dbo.Func(D) as FD
but it returns this error:
Invalid object name 'dbo.Func'
Can I use CROSS APPLY only on TABLE VALUED functions ?
And is CROSS APPLY suitable for scalar functions (converted to table valued function) anyway ? Because on my small performance test CROSS APPLY is a bit slower.