SyntaxFix
Write A Post
Hire A Developer
Questions
It's a table-valued function, but you're using it as a scalar function.
Try:
where Emp_Id IN (SELECT i.items FROM dbo.Splitfn(@Id,',') AS i)
But... also consider changing your function into an inline TVF, as it'll perform better.