Since you are already building the query in a JS Statement, you could try to declare a SQL parameter that is set to the value of that statement, and then EXEC(@theStatement).
1 Like
Since you are already building the query in a JS Statement, you could try to declare a SQL parameter that is set to the value of that statement, and then EXEC(@theStatement).