I am dynamically creating a WHERE clause in my query, and the the "in" statement is only processing the first of the multiple values I pass it. Here's the statement:
I pass into the stored proc @AGProjectKey='5998,10779' and it only returns the record with the key of 5998. Why isn't it processing both keys I'm passing it?
Code:
sSQL = sSQL + 'WHERE tAGProjects.AGProjectKey IN (COALESCE(' + @AGProjectKey + ', tAGProjects.AGProjectKey))'
I pass into the stored proc @AGProjectKey='5998,10779' and it only returns the record with the key of 5998. Why isn't it processing both keys I'm passing it?