复制代码 代码如下:
declare @idoc int;
declare @doc xml;
set @doc=cast(‘<root><item><projid>’+replace(@selectedprojectarray,’,’,'</projid></item><item><projid>’)+'</projid></item></root>’ as xml)
exec sp_xml_preparedocument @idoc output, @doc
select projid from openxml (@idoc, ‘/root/item’,2)
with (
[projid] varchar(10)
)