A simplified version of a table value function with one SQL statement. It is not necessary to declare the output table format. The following example shows how to declare an inline table value function with one parameter, and how to call it from a SELECT statement.
Example: CREATE FUNCTION getOrder ( @orderid int )
RETURNS TABLE
as RETURN ( select * from orders where orderid in (@orderid ) )
select * from getOrder(10248) as OrderInfo