Skip to main content
added 1 character in body
Source Link
Gortonington
  • 30.9k
  • 3
  • 27
  • 64

There is, but it is not intuitive.

You will need to use the CHAR() function in SQL to do this as SFMC SQL Validator will not allow the reserved char ; inside of your query no matter if it is escaped or inside a string.

So for example, you would do: Replace(FIELD,'apos''&apos' + Char(59), Char(39))

Char(59) = ;
Char(39) = '

To help remove the complexity of trying to escape a single quote inside a single quoted string in SQL, I just used the Char() function again to represent the single apostrophe.

ref(http://www.asciitable.com/)

There is, but it is not intuitive.

You will need to use the CHAR() function in SQL to do this as SFMC SQL Validator will not allow the reserved char ; inside of your query no matter if it is escaped or inside a string.

So for example, you would do: Replace(FIELD,'apos' + Char(59), Char(39))

Char(59) = ;
Char(39) = '

To help remove the complexity of trying to escape a single quote inside a single quoted string in SQL, I just used the Char() function again to represent the single apostrophe.

ref(http://www.asciitable.com/)

There is, but it is not intuitive.

You will need to use the CHAR() function in SQL to do this as SFMC SQL Validator will not allow the reserved char ; inside of your query no matter if it is escaped or inside a string.

So for example, you would do: Replace(FIELD,'&apos' + Char(59), Char(39))

Char(59) = ;
Char(39) = '

To help remove the complexity of trying to escape a single quote inside a single quoted string in SQL, I just used the Char() function again to represent the single apostrophe.

ref(http://www.asciitable.com/)

Source Link
Gortonington
  • 30.9k
  • 3
  • 27
  • 64

There is, but it is not intuitive.

You will need to use the CHAR() function in SQL to do this as SFMC SQL Validator will not allow the reserved char ; inside of your query no matter if it is escaped or inside a string.

So for example, you would do: Replace(FIELD,'apos' + Char(59), Char(39))

Char(59) = ;
Char(39) = '

To help remove the complexity of trying to escape a single quote inside a single quoted string in SQL, I just used the Char() function again to represent the single apostrophe.

ref(http://www.asciitable.com/)