• There are definite places where functions are of value, but it is important that they be written carefully to avoid replicating work. In one of the examples listed, the function runs a select statement against the table and then is used inside of a select statement against the same table. It is doing vastly more reads than it needs to. On the other hand, there are places like complex manipulation of a single string that will be done the same way regardless of the strings source can usefully be put into a function with minimal performance hits and increased testing possibilities and code reuse.

    ---
    Timothy A Wiseman
    SQL Blog: http://timothyawiseman.wordpress.com/