select '''' + ID +''',' from 表 for xml path('') 此SQL语句,输出结果如‘1’,’2‘,’3‘, 但是在因xml会出现path转译的问题将‘转成&apos 解决方案: select (select '''' + ID +''',' from 表 for xml path(''),Type).value('.','NVARCHAR(MAX)')…
可以看delph的帮助,里面有这个问题详细说明:A character string, also called a string literal or string constant, consists of a quoted string, a control string, or a combination of quoted and control strings. Separators can occur only within quoted strings. A quoted stri…