I am trying to create a function that takes an input parameter and executes a query based on that.
The function needs to return the entire resultset to the calling environment in the form of an array.
But iam getting an error "Msg 102, Level 15, State 1, Procedure sample_test, Line 25
Incorrect syntax near '@v_input'."
CREATE FUNCTION sample_test (@v_input varchar(max))
RETURNS @returnArray TABLE
SELECT * FROM employees WHERE employeeid IN @v_input AND empstatus = 'A'