UDF and SP what is difference
Hi SQLGurus, might someone explain me with simple words
I created on SQL UDF – quite complex – containing 3-level CTE inside – but single query (RETURNS TABLE AS RETURN(….)
and I created exact same as SP
comparision (I executed together both – select * from UDF and EXEC SP with same parameters goves me that SP runs 5 time quicker than UDF
What is tehnical difference of them and is there some way (SCHEMABINDING or Execute as or something else) to speed up the UDF
Create UDF with EXEC SP inside I’ve not yet tested 🙂
any comment are welcome
Henn Sarv
Hi SQLGurus, might someone explain me with simple wordsI created on SQL UDF – quite complex – containing 3-level CTE inside – but single query (RETURNS TABLE AS RETURN(….)and I created exact same as SPcomparision (I executed together both – select * from UDF and EXEC SP with same parameters goves me that SP runs 5 time quicker than UDFWhat is tehnical difference of them and is there some way (SCHEMABINDING or Execute as or something else) to speed up the UDFCreate UDF with EXEC SP inside I’ve not yet tested :)any comment are welcomeHenn Sarv Read More