Syntax for Creating Inline Table-Valued Functions : Create function « Procedure Function « SQL Server / T-SQL Tutorial






CREATE FUNCTION [ owner_name. ] function_name
    ( [ { @parameter_name scalar_parameter_data_type [ = default ] } [ ,...n ] ] )
RETURNS TABLE
[ WITH { ENCRYPTION | SCHEMABINDING } [ ,...n ] ]
[ AS ]
RETURN [ ( ] select-stmt [ ) ]








21.1.Create function
21.1.1.Scalar functions are functions that return a single value.
21.1.2.Syntax for Creating Inline Table-Valued Functions
21.1.3.Syntax for Creating Multistatement Table-Valued Functions
21.1.4.Creating a User-Defined Function
21.1.5.A statement that creates a simple table-valued function
21.1.6.A statement that creates a scalar-valued function