Procedure Function MSSQL Tutorial

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