Equivalent to PostgreSQL's Dollar-quoted String Constants for SQL Server
5
votes
3
answers
4344
views
Is there an equivalent of PostgreSQL's [Dollar-quoted String Constants](https://www.postgresql.org/docs/9.2/static/sql-syntax-lexical.html) , on SQL Server?
I would like to enter HTML string literals that would potentially contain single or double quotes in them.
Example:
UPDATE table_name
SET column_name = $$
Here's a string that contains "double quotes".
$$
WHERE condition = true
**Edit:**
The reason I'm asking this is because I would like to update some rather big HTML "web parts" that are stored in the database (yuck!). Because at work we use that kind of CMS (which I won't give you the name). So I don't want to have to escape my single quotes every time. That's why I'm asking about that kind of feature. If I understand correctly, [
QUOTENAME
](https://learn.microsoft.com/en-us/sql/t-sql/functions/quotename-transact-sql) would still require me to double my single quotes.
Asked by Julien
(151 rep)
Nov 17, 2017, 05:18 PM
Last activity: Feb 3, 2023, 09:22 PM
Last activity: Feb 3, 2023, 09:22 PM