Stored Procedure vs Functions compilation and performance difference

Viewed 5456

Recently I gave an inetrview in which the interviewer asked me to explain the most basic difference between Stored Procedure and UDF's.

I was able to recall a couple of differences as listed here but he didn't accept any of them as the BASIC difference.

Answer according to him was that SP's are only compiled once while UDF's are compiled everytime they are called resulting in UDF's being considerably slower than stored procedure.

Now I have searched but couldn't get a clear cut answer whether this assertion is true. Please verify this.

3 Answers
Related