Procedure Function MSSQL Tutorial

CREATE FUNCTION [owner_name.]function_name
    ([@parameter_name data_type [= default]] [, ...])
RETURNS data_type
[WITH {ENCRYPTION|SCHEMABINDING|ENCRYPTION,SCHEMABINDING}]
[AS]
BEGIN
    [sql_statements]
    RETURN scalar_expression
END