Introduction:

In this tutorial we will learn how to create Inline table valued function in SQL server and how to accept input parameters and it will return table with example.

Description:

The inline table valued function are similar to multi-statement table valued function. inline function return a table. the inline function consists of only a single select statement query. Inline functions can be used to achieve the functionality of parameterized views. Views do not support parameters in the search conditions specified in the WHERE clause. Inline functions can be used to support parameters in the search conditions specified in the WHERE clause.  When we need to get records with search conditions in that case we can be use inline function. 

Create inline table valued function :


CREATE FUNCTION dbo.GetStudent(@name nvarchar(100))
RETURNS table
AS
RETURN
(
SELECT * from student where Name like '%'+@name+'%'
)


Here we are going to call SQL Server function shown below:

 

select * from dbo.GetStudent('a')

OutPut

How to Use Inline table valued  in SQL server

Thanks.

2 Comments

  1. Inline table valued in SQL server Aditya Patel
    7/13/2018 10:26:00 PM

     Inline table valued in SQL server read on http://www.mindstick.com

    https://www.mindstick.com/Articles/12999/what-is-table-valued-function-in-sql-server


  2. By:priyanka patel priyanka patel
    6/1/2019 5:16:09 AM

    good article.



Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

You may also like