• I believe it should conceptually look something like:

    select @sql = @sql + 'and ' + @system_Status + ' LIKE ''%,'' + system_Status + '',%'''

    but I'm generating an error: An expression of non-boolean type specified in a context where a condition is expected, near ','.