O'Reilly logo

Guru's Guide to SQL Server™ Stored Procedures, XML, and HTML, The by Ken Henderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Limitations

There are a number of limitations and restrictions that apply exclusively to UDFs:

  • Except for inline functions, the outer BEGIN…END pair is required with UDFs. This differs from procedures and triggers. Curiously, the outer BEGIN…END enclosure is not only not required with inline functions, it's not allowed; you'll get a syntax error if you try to include it.

  • Calls to scalar UDFs must be owner qualified. Note the dbo. prefix on the call to the Proper() function used earlier. There's an undocumented way around this requirement that we'll discuss momentarily.

  • The last statement in a UDF must be RETURN.

  • There are a number of restrictions on the T-SQL you can use inside a function. Basically, you aren't allowed to do anything that might ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required