I have created table valued function. I am calling like this
select * from dbo.fun_sample(1)
It is working fine. I have table called Emp
Table Emp
Id Name Lname
1 Rani Kale
My select Statement is like this
Select id,Name,Lname from Emp
By passing value of id to function ,I want fetch table(having 2 column).But is not working
Select id,Name,Lname,(select * from dbo.fun_sample(1)) from Emp
use CROSS APPLY
Select e.id,e.Name,e.Lname from Emp e
CROSS APPLY dbo.fun_sample(1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With