In Microsoft SQL Server 2000 or higher, developers can create a user-defined function that returns a table. Such functions are useful for performing complex or procedural logic. Developers can write a query that uses the fn_GetSomeData function as a source of data. The resulting SQL might look like this:

C# 8.0 and .NET Core 3.0 – Modern Cross-Platform Development: Build applications with C#, .NET Core, Entity Framework Core, ASP.NET Core, and ML.NET using Visual Studio Code, 4th Edition
ASP.NET Core 3 and Angular 9: Full stack web development with .NET Core 3.1 and Angular 9, 3rd Edition
C# in Depth, 4th Edition

SELECT *

FROM

fn_GetSomeData (‘JKL12345YH’)