JsonEscape
Returns a JSON escaped string
- Free Function
- SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017
SELECT SQLHTTP.net.JsonEscape ( @JsonValue )
Name | Type | Description |
---|---|---|
@JsonValue | nvarchar(MAX) | Json value to escape |
nvarchar(MAX)
Json escaping is NOT always identical to Regex escaping, but Json un-escaping IS always identical to Regex un-escaping.
1 2 3 4 5 6 7 |
DECLARE @JsonValue nvarchar(MAX) SET @JsonValue = '"C:\temp"' SELECT SQLHTTP.net.JsonEscape(@JsonValue) |
1 2 3 4 |
---------------- \"C:\\temp\" |