如果您可以更改架构,请考虑将数据类型从更改
ntext为
nvarchar(max)。后者是SQL Server
2005中的新功能,效率更高,并且可以与字符串函数一起使用。
如果您无法更改架构,请将转换
ntext为type的局部变量
nvarchar(max)。字符串函数可以使用
nvarchar(max)。例子:
declare @txt nvarchar(max)select @txt = NTextField from YourTable where id = @ID... process @txt ...update YourTable set NTextField = @txt where id = @ID



