Reviewing Advanced UDF Topics

Although creating a user-defined function is a fairly simple process, using them is a bit more interesting. Of course, to repeat myself, when you decide to create a UDF for your database, you need to do some analysis on what you really want the function to do and what type of information the function will return when it is executed. In addition, when you create user-defined functions, the performance of the function is very important because it will be used by many programs to access information from the database.

Finally, you saw earlier in this lesson that errors must be accounted for in a UDF just as in triggers and stored procedures. However, the server responds to errors in a UDF in a slightly different way. ...

Get Sams Teach Yourself Transact-SQL in 21 Days, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.