[S] SQLXML使用时出现超奇怪问题
在Table1表中只有一个ntext字段 s
执行下面的SQL
declare @a nvarchar(200)
set @a = '<s>asdfasfasd</s>'
declare @tree int
exec sp_xml_preparedocument @tree output, @a
update table1 set s=t.s from openxml (@tree, '/', 2) with (s ntext '/s') as t
exec sp_xml_removedocument @tree
go
结果居然是:
(0 rows affected)
这是怎么回事,我发现只要把 with (s ntext '/s') 中的ntext 换成nvarchar就会正常。不知道有没有人知道原因,和解决方法?
分不够可再加