Can someone please explain why this is happening on SQL Server 2008:
declare @sql Nvarchar(max);
set @sql =N'';
select @sql = @sql +replicate('a',4000) + replicate('b', 6000);
select len(@sql)
Returns: 8000
Multiple sites suggest that as long as first variable is of type NVARCHAR(MAX), truncation should not occur, but it still does.