September 2010
Intermediate to advanced
1704 pages
111h 8m
English
You create T-SQL functions by using T-SQL statements. You can enter the T-SQL code in sqlcmd, SSMS, or any other third-party query tool that allows you to enter ad hoc T-SQL code. The following sections first show the basic syntax for creating functions and then show how you can create functions by using the features of SSMS.
User-defined functions can accept 0–2,100 input parameters but can return only a single result: either a single scalar value or table result set.
The T-SQL syntax for the CREATE FUNCTION command for scalar functions is as follows:

The syntax for the CREATE FUNCTION ...