要转换的XML
DECLARE @xml XML=N'<root><param id="1">55.3</param><param id="2">76.98</param></root>' SELECT N.v.value('.', 'decimal(24,4)') AS I_RNumber, N.v.value('@id[1]', 'int') AS IType FROM @xml.nodes('/root/param') AS N(v)
执行结果
要转换的XML
DECLARE @xml XML=N'<root><param id="1">55.3</param><param id="2">76.98</param></root>' SELECT N.v.value('.', 'decimal(24,4)') AS I_RNumber, N.v.value('@id[1]', 'int') AS IType FROM @xml.nodes('/root/param') AS N(v)
执行结果