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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Aug 29, 2012, 4:17 AM EDT
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 IvaturiRank #473 · 5.3K reputationPosted Aug 29, 2012, 4:03 AM EDT
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')
satheesh d190 reputationPosted Nov 20, 2021, 5:19 AM EST
Rijwan AnsariRank #82 · 24.2K reputationPosted Nov 20, 2021, 9:12 AM EST