T-SQL User-Defined Functions: the good, the bad, and the ugly (part 1)

Posted by Hugo Kornelis on SQL Blog See other posts from SQL Blog or by Hugo Kornelis
Published on Sun, 20 May 2012 14:08:00 GMT Indexed on 2012/05/30 16:54 UTC
Read the original article Hit count: 366

Filed under:
|
|
So you thought that encapsulating code in user-defined functions for easy reuse is a good idea? Think again! SQL Server supports three types of user-defined functions. Only one of them qualifies as good. The other two – well, the title says it all, doesn’t it? The bad: scalar functions A scalar user-defined function (UDF) is very much like a stored procedure, except that it always returns a single value of a predefined data type – and because of that property, it isn’t invoked with an EXECUTE statement,...(read more)

© SQL Blog or respective owner

Related posts about Personal

Related posts about t-sql