replace ntext (more than 4000 characters) in sql server 2000

久未见 提交于 2019-12-10 16:35:14

问题


How to replace text in sql server 2000 in a ntext column with more than 4000 characters? conversion to nvarchar(max) does not work as it truncates values.


回答1:


Working with TEXT/NTEXT is a mess - one of the many reason to get rid of those fields as quickly as possible.

You need to manipulate those with command such as READTEXT, WRITETEXT, UPDATETEXT and other - see some resources for help:

  • MSDN docs on READTEXT
  • MSDN docs on WRITETEXT
  • MSDN docs on UPDATETEXT
  • How do I handle REPLACE() within an NTEXT column in SQL Server?
  • Update Text, NText Columns using UPDATETEXT Command in MS SQL Server



回答2:


nvarchar(max) isn't supported until sql server 2005. For sql server 2000 columns with more than 4000 wide characters, you must pull the data down to a client application and make your changes there.



来源:https://stackoverflow.com/questions/2133635/replace-ntext-more-than-4000-characters-in-sql-server-2000

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!