How to write a xquery in SQL Server to read all the childnodes from an XML data column in a table?

Here's one solution: DECLARE @xml XML = ' 2023038.09 265128.090 459868.090 16000.01 55208.090 2148.090 1565558.090 17178.090 8348.090 -117264378.090 -160898.090 ' SELECT T.c. Value('local-name(.)1', 'varchar(100)') AS Element, T.c. Value('.

/text()1', 'decimal(17,2)') AS Value FROM @xml. Nodes('//item/child::node()') T(c) Returning the ordinal position of a node is more difficult than it looks This question suggests one solution but I haven't implemented it here as it's a bit of a hack.

Here's one solution: DECLARE @xml XML = ' 2023038.09 265128.090 459868.090 16000.01 55208.090 2148.090 1565558.090 17178.090 8348.090 -117264378.090 -160898.090 ' SELECT T.c. Value('local-name(.)1', 'varchar(100)') AS Element, T.c. Value('.

/text()1', 'decimal(17,2)') AS Value FROM @xml. Nodes('//item/child::node()') T(c); Returning the ordinal position of a node is more difficult than it looks. This question suggests one solution but I haven't implemented it here as it's a bit of a hack.

This is absolutely perfect! Thank you Harper. I just made few changes to your query for solving my needs.. SELECT T.c.

Value('local-name(.)1', 'varchar(100)') AS Element, T.c. Value('. /text()1', 'varchar(100)') AS Value FROM dbo.

QueryResult QR WITH(NOLOCK) CROSS APPLY Result. Nodes('//OUTPUT/item/child::node()') AS T(c) – Charan Jul 23 at 5:59.

FROM @xml. Returning the ordinal position of a node is more difficult than it looks. This question suggests one solution but I haven't implemented it here as it's a bit of a hack.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions