Primitive JSON data types

JSON is designed to be lightweight and supports only four primitive data types:

  • Numbers: This is a double-precision float
  • String: Unicode text surrounded by double quotes
  • True/false: Boolean values; they must be written in lowercase
  • Null: This represents a null value

As you can see, there is no date data type. Dates are represented and processed as strings. A JSON string is a sequence of Unicode code points wrapped with quotation marks. All characters may be placed within the quotation marks, except for the characters that must be escaped. The following table provides the list of characters that must be escaped according to this specification and their JSON conform representation:

JSON escaping rules

Special ...

Get SQL Server 2017 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.