日期:2014-05-16 浏览次数:20717 次
declare @xml xml
DECLARE @idoc int
select @xml='<Root>
<List>
<contentstr> aaaa bbbb </contentstr>
</List>
</Root>'
select @xml = REPLACE(CONVERT(NVARCHAR(MAX),@xml),' ','@') --转一下
exec sp_xml_preparedocument @idoc output,@xml
SELECT replace(contentstr,'@',' ') AS contentstr --再转回来
FROM OPENXML(@idoc, '/Root/List',2)
WITH(contentstr Nvarchar(max))