sql - NVARCHAR(MAX) doesn't accommodate 50478 characters -


i'm trying store string of 50478 characters length in nvarchar(max) database field. according this link, tells nvarchar(max) field can store 1 billion characters, when tried store 50478 characters sql truncates them , doesn't store full string.

how solve such problem?

do think printing problem sql server management studio?

you need ensure data being inserted field cast nvarchar otherwise not able achieve you're looking for.

take example:

create table #temp (this nvarchar(max))  insert #temp values (replicate(cast('a' nvarchar(max)), 50478))  select this, len(this) #temp  drop table #temp 

also can viewed on sql fiddle here: http://sqlfiddle.com/#!6/551f7/2/0


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -