运行:
SELECT [负责人] = CONVERT(XML,'<root><v>'
+ REPLACE(F5_4115, ',' , '</v><v>')
+ '</v></root>'
)
FROM TB_OBJECT_4115
程序提示:消息 9421,级别 16,状态 1,第 1 行
XML 分析: 行 1,字符 61,非法的名称字符
请问是什么原因?
什么情况会造成【非法的名称字符】的提示。
谢谢!~~
F5_4115字段的数据:
Vadim Tsudikman, Sergey Izraylevich
NULL
Paul Matthews, Paolo Kind, George Polychronopoulos, Domenico Veronese
Steven D. Holzman, Sin-Ming Shaw, Tiziano Terzani, Philip L. Tose
Mark Ostroff
NULL
John Brecker, Steven Weissman, Roderick Stephan, Vladimir Jelisavcic
Gilbert de Botton, Andrew J. Ashworth, Michael S. Bunker, Jozef C. Hendriks, Paul S. Kirkby, John D.H. Mackenzie, Peter Payne, Franz C. Winkelmann.
Paul Flather (Hermes Advisors in San Diego tel. 858-350-064
NULL
John Curran, Roxana Zirakzadeh
NULL
Alice Bordini
Sean McGould, Kelly Perkins, Jonathan Carroll, Robert Swan, Kevin Lakin, Chris Barr, Henry Perry, Dana Hall
------解决方案--------------------
-- Verstion:
-- Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (Intel X86)
-- Apr 2 2010 15:53:02
-- Copyright (c) Microsoft Corporation
-- Enterprise Evaluation Edition on Windows NT 6.1 <X64> (Build 7600: ) (WOW64)
------解决方案--------------------
当你的 f5_4115 列值中存在字符 "<" 时,会出错.
------解决方案--------------------
试试:
select * from tb_object_4115 where charindex('<',f5_4115)>0
------解决方案--------------------
或者试试:
SELECT [负责人] = CONVERT(XML,'<root><v>'
+ REPLACE(F5_4115, ',' , '</v><v>')