'Escape '\' in dynamic content in Azure Data Factory

I am hitting a query through lookup activity on DB2 Database using ADF.

Query is: enter image description here

But when I execute the query the '\' count gets double. The output is provided in the below screenshot. enter image description here

As you can see in the screenshot given, the '\' count gets double. I need a solution to remove these extra '\' coming in my query.



Solution 1:[1]

By default, backslash escape character \ gets doubled when used in the Azure data factory.

Use replace function in your expression to replace double backslash with single backslash.

Example:

@replace('\\abc\\','\\','\')

enter image description here

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 NiharikaMoola-MT