I entered the following expression into the expression builder for a Lookup activity based on a query:
@replace('SELECT TOP 1 * FROM dbo.Tag WHERE (ConversationId = {Id} AND Key=''assignment'')','{Id}',string(pipeline().parameters.ConversationId))
It causes the activity to fail with the following error :
Incorrect syntax near the keyword 'Key'
...I've been trying to find the right syntax for the last 45 minutes. Help!
If the problem is indeed that I'm incorrectly escaping a single quote then I'm extremely confused because every StackOverflow answer says that this is the right way to escape them (two single quotes in a row).
Note: Key
is the actual column name. And it does ave a value that is the literal string 'assignment'
.