Hello @Aman Sharma ,
Welcome to the Microsoft Q&A platform.
I had done a quick repro at my end and was not able to repro the issue on a normal circumstance.
I did see that you are making use dynamic content. I did try using the dynamic content. I was not still provided with the error.
However, when the dynamic content contain single quote (') within the body.
Something like below :
I was provided with the error as yours.
If this is your case i.e. activity('1-Demo_data').Error.Message - has a string returned with single quotes (') in the output(dynamic content). You're likely to encounter the behavior.
The error is because - the Single Quote (') is used to denote string boundary and this is causing the error while execution. If you want to represent a single quote (') within the string - we are supposed denote using ''
(two single quotes)
Since, quote(') was causing the issue, I replaced the quote(') in the given string with a null using the replace()
function.
This is 'with2' ---> This is with
Change at my end
Update [SalesLT].[Address]
set StateProvince='@{replace(variables('Error'),'''','')}'
Select getdate();
Output :
The below would be snippet change at your end.
'@{replace(activity('1-Demo_data').Error.Message,'''','')}'
Note: Replacing the single quote (') with blank - the above snippet removes all the occurrence of the single quotes (') in the string.
If you want to retain the Single Quote in the Message string, you could use the below snippet :
'@{replace(activity('1-Demo_data').Error.Message,'''','''''')}'
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on or upvote button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators