How to declare a function (T-SQL)

CREATE FUNCTION MyFunction
(
@EntryParam BIGINT
)
RETURNS BIGINT --the returned type
AS
BEGIN
DECLARE @ReturnVar AS BIGINT -- the var to keep the return value
..... -- set @ReturnVar's value
RETURN @ReturnVar
END

No comments: