O'Reilly logo

Writing Stored Procedures for Microsoft SQL Server by Matthew Shepker

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

User-Defined Functions

SQL Server user-defined functions are created using the CREATE FUNCTION command . Any created function can take zero or more input parameters of any type except timestamp, cursor, or table. User-defined functions pass back a single value as defined in the RETURNS section of the CREATE FUNCTION. User-defined functions can return any data type except text, ntext, image, cursor, or timestamp.

All user-defined functions must comply with all naming standards set forth for all objects in the database. Unlike other objects in the database, when you call a user-defined function, you must use the qualified object name, in the format of owner_name . function_name , as follows :

SELECT * FROM dbo.fncReturnScalarValue

As with ...

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