开发者

Modifying value of ntext column

I have a column in ntext which holds large unicode strings longer than 4000 chars in length. I need to update/modify the data of the rows of the column in sql but I have no clue how to do so. I have tried nvarchar(max) as a buffer but it truncates the data into 4000 chars.

Could anyone help me give me a hint or an idea or a workround solution, because I'm really lost in thi开发者_Go百科s one?


nvarchar(max) does not truncate.

You have an intermediate nvarchar(4000) (or shorter) somewhere, usually a string constant. See my answer for more info: For Nvarchar(Max) I am only getting 4000 characters in TSQL?

If you can cast to nvarchar(max), then it means you can change your columns too... As Remus said, ntext is deprecated.


Replace the obsolete type NTEXT with the more appropriate NVARCHAR(MAX) and use the UPDATE SET column.Write syntax, see Using Large-Value Data Types.

The old type NTEXT supports the UPDATETEXT, but is obsolete now.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜