I'm trying to manually update a SQL Server column of type nvarchar(max) with a huge JSON parsed as text.
It's a simple, straightforward query:
UPDATE Books
SET Story = ''
WHERE Id = 23
The problem happens when the JSON I try to insert into Story contains a huge value, part of the JSON (I think the breaking point was around 38k characters)
"Text": "testtesttesttest..." (imagine the value is 50k characters)
Usually text values in single quotes in SQL Server Management Studio are red, this one isn't because of the huge value. If I break the text into multiple new lines, then it is accepted as a 'valid' string, but the JSON validation fails -
JSON text is not properly formatted. Unexpected character ' ' is found at position 33043.
I also tried splitting the big line using + CHAR(13) +', but did not succeed.
Is there a way to update the value while maintaining the whole JSON?


''isn't valid JSON.