Microsoft SQL Server Storing JSON in SQL tables JSON stored as text column

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

JSON is textual format, so it is stored in standard NVARCHAR columns. NoSQL collection is equivalent to two column key value table:

CREATE TABLE ProductCollection (
  Id int identity primary key,
  Data nvarchar(max)
)

Use nvarchar(max) as you are not sure what would be the size of your JSON documents. nvarchar(4000) and varchar(8000) have better performance but with size limit to 8KB.



Got any Microsoft SQL Server Question?