I am trying to pass a string of employee numbers to a stored procedure and can't get it right. I have seen the use of this:
Where CHARINDEX( ',' + Emps.repno + ',', ',' + @RepList + ',' ) > 0
but can't get it to work like I need. I need the list of employees numbers to be used in a NOT IN clause instead, like
Where Emps.repno NOT IN ('ABC', 'DEF')
I am passing 'ABC', 'DEF' to the stored procedure and @RepList is the parameter name where I am passing the string of 'ABC', 'DEF'
TIA
Bill