sql create function return table AS RETURNS code example Example: execute table valued function in sql SELECT * FROM udfProductInYear(2017);