SQL server has support for XML, but I cannot figure out how to get it to work with the list type
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema id="XMLSchema1"
targetNamespace="http://tempuri.org/XMLSchema1.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/XMLSchema1.xsd"
xmlns:mstns="http://tempuri.org/XMLSchema1.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="valuelist">
<xsd:list itemType="xsd:integer"/>
</xsd:simpleType>
<xsd:element name="a" type="valuelist"/>
I cannot figure out how to make this work:
DECLARE @p0 AS XML
SET @p0 = '<a>123 124</a>'
select ??? from @p0.???
This one works fine, but it has an overhead of 6 chars extra per number:
DECLARE @p0 AS XML
SET @p0 = '<b>123</b><b>124</b>'
select T.c.value('.', 'int') as Id from @p0.nodes('/b') AS T(c)