SqlCommand s2 = new SqlCommand();
s2.CommandText = @"declare @sql nvarchar(max);
set @sql = 'select sys_RespNum from ' + quotename(@tableName) + 'where' + 'respid' + 'in' + '(' + @emails + ')';
exec (@sql);
What's wrong with the code? I get an error:
Incorrect syntax near @emails