4 ms·
The article points out that you can use their ISJSON function as a check constraint on your column, guarding it from malformed data: > ISJSON( jsonText ) that
by bjg 11y ago
The article points out that you can use their ISJSON function as a check constraint on your column, guarding it from malformed data:
> ISJSON( jsonText ) that checks is the NVARCHAR text input properly formatted according to the JSON specification. You can use this function the create check constraints on NVARCHAR columns that contain JSON text.
- __Joker 11y agoNot to nitpick. But you want this validation to be default. In this case which it can't be. Question is what stopped MS to just wrap this NVARCHAR with json validation and json access and give it as json type. May be native json type will be added in future versions. I think just they wanted to ball to rolling.
- taspeotis 11y ago> Question is what stopped MS to just wrap this NVARCHAR with json validation and json access and give it as json type A large part of the blog post [1] is dedicated to this issue? > In SQL Server 2016, JSON will be represented as NVARCHAR type. There are three reasons for this: [1] http://blogs.msdn.com/b/jocapc/archive/2015/05/16/json-support-in-sql-server-2016.aspx http://blogs.msdn.com/b/jocapc/archive/2015/05/16/json-suppo...
- biot 11y agoThanks... I somehow missed the check constraint ability, which addresses the malformed data issue.