Sunday, September 18, 2016

String_escape() new in SQL Server 2016

When compared to an earlier version, SQL Server 2016 has two new string functions shown in the next image.


The syntax for the new function:
STRING_ESCAPE(text, type)

text is nvarchar expression representing the object to be escaped and type is the the rule to be applied and presently the rule is only for type 'json'. This was required because SQL Server 2016 supports JSON and some of the special characters in the data may not give the correct JSON format.

The return type of json supported are shown in this table.


Some of these tested in the SQL Server Management Studio 2016 are shown here:

Form Feed is seldom used and I do not know what the purpose is and the same with backspace.

Read more here:

Get started with latest release of Microsoft SQL Operations Studio

Read my previous articles (9) on previous versions. Download the February (latest) release of Microsoft SQL Operations Studio here . T...