in oracle 12c it is possible to have an inline user defined function
WITH
FUNCTION with_function(p_id IN NUMBER) RETURN NUMBER IS
BEGIN
RETURN p_id;
END;
SELECT with_function(id)
FROM t1
WHERE rownum = 1
is there an equivalent in sql server? I have been researching for awhile but can not seem to find an equivalent.