DECLARE @Ids xml
set @Ids =‘<Id>100016022611240001</Id><Id>100016022614110001</Id><Id>100016022615120001</Id>‘
SELECT ParamValues.ID.value(‘.‘,‘bigint‘) as Id
FROM @Ids.nodes(‘/Id‘) as ParamValues(ID)
====================================================
DECLARE @data XML
set @data=‘
<ids>
<id>1</id>
<id>2</id>
</ids>
‘
select T.c.value(‘(.)[1]‘,‘varchar(10)‘) as id
from @data.nodes(‘/ids/id‘) T(c)
时间: 2024-11-08 07:45:03