I was asked to help with an issue where the user was trying to update a column with a large amount of text. It was only inserting the first 4000 characters
The table has a column - nvarchar(MAX) and they were using SQL Management studio.
The solution was to
DECLARE @string1 nvarchar(MAX)
DECLARE @string2 nvarchar(MAX)
SET @string1 = 'SOME TEXT less than 4000 chars'
SET @string2 = 'The rest of the TEXT'
Update table
Set TheColumn = @string1 + @string2
It looks as if even though the declaration of the variable is nvarchar(MAX) it is actually nvarchar(4000) .