This runs fine in a query window. But when placed inside a job, it truncates the variable @JSONResponseText.
EXECUTE sp_ExecuteSQL @SQL , @Parameter_Definition , @pi_Environment = @Environment , @pi_Verb = @Verb , @pi_URL = @URL , @po_JSONResponseText = @JSONResponseText OUTPUT --SELECT @JSONResponseText
I have to add this before the execute in the job to make it work.
SET TEXTSIZE -1
Why do I have to add the above in the job but not the query window?
Also, when running a job, who should I run the job as? Is there a generic role that I should use?