Thank you.
Inline function in SQL Server
I want to know what is Inline function in SQL server.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rijwan AnsariPosted Nov 20, 2021, 2:12 PM
satheesh dPosted Nov 20, 2021, 10:19 AM
Jignesh TrivediPosted Aug 29, 2012, 8:17 AM
Please refer
http://msdn.microsoft.com/en-us/library/aa214762%28v=sql.80%29.aspx
http://msdn.microsoft.com/en-us/library/aa175924%28v=sql.80%29.aspx
Akkiraju IvaturiPosted Aug 29, 2012, 8:03 AM
For example consider the following view
Create view myView as
select employeeid from employees where company = 'Microsoft'
If you would like to introduce a variable called company you cannot do it in the above view and for this purpose we can use inline user defined function. It is as below:
create function fn_GetEmployeesOfCompany
(@company nvarchar(500))
returns table
as
return (select employeeid from employees where company = @company)
go
you can call the above function as below:
select * from fn_getemployeesofcompany(n'Google')