The problem with the statement (below) snipped from a stored procedure Ive been using is that previously it worked fine, however more joins have been added to the procedure, and the SELECT query now exceeds 4000 chars.
I've been trying to get it to work, by removing sp_executesql, and using EXEC on its own, e.g.
EXEC @status2 = (@sql_select + @sql_from + @sql_where + @sql_order_by),
but my syntax is wrong and I can't figure it out. Can anyone help please? Thank you thank you in advance....:-)
I cant reduce the number of characters to less than 4000 so apparently I need to execute the statement using EXEC instead of sp_executesql (which wont take concatenated strings). I need to use Unicode here.