Inline functions are same like views. It has single select statement and it returns a table. So we can use an inline function like a view in our query. I have explained scalar function in my previous article which returns a scalar value of particular data type. Inline function returns a table whether a single value returns or multiple values return. We cannot handle so much complexity in inline functions because they include a single select statement.
Create Inline Function
CREATE FUNCTION dbo.CustomerOrders
FROM dbo.Orders WITH(NOLOCK)
WHERE CustomerID = @CustomerID)
Call Inline function
SELECT TOP (10) *
FROM dbo.CustomerOrders(12) WITH(NOLOCK) AS CustomerOrders
Best WordPress Themes and Plugins with Great Team and Support!