Home
Options

Updating columns of size nvarchar(max)....

edited March 2022

I've created a script to update a column of size nvarchar(max). Upon calling SubmitChanges(), I see the following output in the SQL window....

-- Region Parameters
DECLARE @p0 Int = 3065
DECLARE @p1 NVarChar(1000) = 'very long string here...' -- (first 1000 characters/1610 shown)
-- EndRegion

UPDATE [Requests]
SET [Data] = @p1
WHERE [Id] = @p0
GO

It appears that the data updated correctly, but wouldn't the assignment of a string greater than 1000 characters to @p1 get truncated? Don't get me wrong, I'm glad my data updated correctly and didn't get lost. I'm just confused why I didn't lose data.

UPDATE:
The data context is built using the LINQ to SQL driver along with the SQL Azure provider.

Sign In or Register to comment.