Unclose quotation marks error

I have tried both 1.7.1 and 1.6.1 versions of UiPath.Database.Activities. As shown in the logs, the exact query being run is:

UPDATE [*xxxxxx*_TEST].[dbo].[REQUEST_DETAILS] SET [REQUEST_STATUS] = 2, [REQUEST_COMPLETION_DATE ] = GETDATE(), [REQUEST_UPDATED_PGRM_NAME] = 'UiPath RPA', [REQUEST_ERROR_MSG] = '' WHERE [REQUEST_ID] = '5'

I also tried it this way:

UPDATE [xxxxxx_TEST].[dbo].[REQUEST_DETAILS] SET [REQUEST_STATUS] = 2, [REQUEST_COMPLETION_DATE ] = GETDATE(), [REQUEST_UPDATED_PGRM_NAME] = 'UiPath RPA', [REQUEST_ERROR_MSG] = '' WHERE [REQUEST_ID] = 5

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.

Hey @postwick

Just to confirm, the error occurs on runtime, and not during design time, correct?

I checked as far as design time on my Studio 2023.10.3 and I didn’t get any validation error, and thus this small follow up question.

Correct, it’s at runtime. The error is being returned by SQL Server.

Please let me know if you have any ideas about what’s causing this

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.