Sample Table Value Function in SQL :
We can call this function in our query like as shown below:
SELECT * FROM dbo.MyTestFunc(14)
CREATE FUNCTION MyTestFunc
(
@UserId INT
)
returns table as
return
(
Select * from User_Info_Master WHERE
UserId=@userId
)We can call this function in our query like as shown below:
SELECT * FROM dbo.MyTestFunc(14)