xml nodes()

DECLARE @T varchar(max) 
SET @T = 
'
   
       
               
               
       

   

   
       
               
               
       

   

'
DECLARE @X xml
SET @X = CAST(@T as xml)
SELECT Y.col.value('../../@FieldRowId', 'int') as FieldID, 
       Y.col.value('@Name', 'varchar(max)') as "Name"
FROM @X.nodes('/root/Field/Items/Item') as Y(col)

转载于:https://www.cnblogs.com/netfuns/archive/2010/11/05/1870157.html

你可能感兴趣的:(xml nodes())