Παιδιά καλησπέρα, δεν μπορώ να καταλάβω γιατί στο select που κάνω στο τέλος δεν μου επιστρέφει και τις 3 γραμμές από το xml.
ευχαριστώ
CREATE TABLE #Xml ( Data XML )
DECLARE @Data XML
set @Data=N'
<resultset>
<row>
<column name="PieceNo">1</column>
<column name="PieceNoEvalUnit">655360</column>
<column name="PieceIdent">Function check1</column>
<column name="RequestNo">1</column>
</row>
<row>
<column name="PieceNo">2</column>
<column name="PieceNoEvalUnit">655362</column>
<column name="PieceIdent">Function check2</column>
<column name="RequestNo">1</column>
</row>
<row>
<column name="PieceNo">3</column>
<column name="PieceNoEvalUnit">655364</column>
<column name="PieceIdent">Function check3</column>
<column name="RequestNo">1</column>
</row>
</resultset>'
INSERT INTO #Xml( Data)
values(@data)
SELECT * FROM #Xml
select
data.value('(resultset/row/column/text())[1]', 'int') as PieceNo,
data.value('(resultset/row/column/text())[2]', 'int') as PieceNoEvalUnit,
data.value('(resultset/row/column/text())[3]', 'varchar(255)') as PieceIdent,
data.value('(resultset/row/column/text())[4]', 'int') as RequestNo
from
#Xml
DROP TABLE #Xml
Dionisis