But I’m getting this error, which makes no sense. I’m using literally the same query in another automation and it works fine (just different database name).
Unclosed quotation mark after the character string ‘5’. Incorrect syntax near ‘5’.
I can literally copy/paste the query from the Orchestrator Job log to MS SQL Mgmt Studio, and the query works fine.
Could the problem be cause by the text brackets? [ ] ? In certain activities they also have another functionality. Maybe UiPath applies some escaping here causing an invalid query being executed?
It could be a decent hint. Maybe checking out how this is saved in the xaml file could show some more information.
Also, maybe passing part of/the whole command as a string variable (but I’m not holding my breath for this one).
Last option, low chance - to use double quotes escaped by double quotes instead of the single ones: ""5""
Ultimately, I feel like it would be best to compare the actual request that is sent, maybe captured via Fiddler or a similar tool, to be able to compare what is issued from Studio and what is issued from MS SQL mng studio.