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.
More Related Contents:
- Does query plan optimizer works well with joined/filtered table-valued functions?
- T-SQL: Opposite to string concatenation – how to split string into multiple records [duplicate]
- Check if table exists in SQL Server
- Sql Server string to date conversion
- Insert multiple rows WITHOUT repeating the “INSERT INTO …” part of the statement?
- Does T-SQL have an aggregate function to concatenate strings? [duplicate]
- Parameter Sniffing (or Spoofing) in SQL Server
- How to get Time from DateTime format in SQL?
- SQL Server String or binary data would be truncated
- Datatype for storing ip address in SQL Server
- How to change identity column values programmatically?
- Cannot truncate table because it is being referenced by a FOREIGN KEY constraint?
- How much size “Null” value takes in SQL Server
- best way to convert and validate a date string
- SQL Server ORDER BY date and nulls last
- How to remove accents and all chars a..z in sql-server?
- Find non-ASCII characters in varchar columns using SQL Server
- WHERE clause on SQL Server “Text” data type
- SQL Server error on update command – “A severe error occurred on the current command”
- Aggregate bitwise-OR in a subquery
- SQL server schema and default schema
- how to write number to word function in sql server [closed]
- SQL Server 2008 – How do i return a User-Defined Table Type from a Table-Valued Function?
- Check if a string contains a substring in SQL Server 2005, using a stored procedure
- FOR XML PATH(”): Escaping “special” characters
- What are row, page and table locks? And when they are acquired?
- @@ERROR and/or TRY – CATCH
- Using the result of an expression (e.g. Function call) in a stored procedure parameter list?
- Incorrect syntax near the keyword ‘with’…previous statement must be terminated with a semicolon
- Random record from a database table (T-SQL)