Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
;WITH XMLNAMESPACES ( default 'http://schemas.microsoft.com/office/infopath/2003/myXSD/2011-12-28T21:32:27')SELECT c.value('field1[1]','varchar(100)'), c.value('field2[1]','varchar(100)') --, other nodes hereFROM YourTable y CROSS APPLY yourXmlCol.nodes('//myFields') t(c); @x.nodes('//myFields') t(c);
sqldba20
Posting Yak Master
183 Posts
Posted - 2012-02-21 : 13:23:57
What will be in the @x ?
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2012-02-21 : 14:05:16
quote:Originally posted by sqldba20 What will be in the @x ?
@x is actually variable that contains XMLwhere is XML stored now?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
sqldba20
Posting Yak Master
183 Posts
Posted - 2012-02-21 : 15:18:38
It is stored in a table.
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts
Posted - 2012-02-21 : 15:27:56
My bad sqldba and Visakh. That last line should not even be there. Copy/paste error, I guess.
;WITH XMLNAMESPACES ( default 'http://schemas.microsoft.com/office/infopath/2003/myXSD/2011-12-28T21:32:27')SELECT c.value('field1[1]','varchar(100)'), c.value('field2[1]','varchar(100)') --, other nodes hereFROM YourTable y CROSS APPLY yourXmlCol.nodes('//myFields') t(c);