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.
Author |
Topic |
subhaoviya
Posting Yak Master
135 Posts |
Posted - 2012-09-27 : 07:46:34
|
Hi, I have a table t1 with column xml1.the xml1 has the value likein row 1<ROOT><MyVal v1="a"><MyVal v1="b"><MyVal v1="c"><MyVal v1="d"></ROOT>in row 2<ROOT><MyVal v1="u"><MyVal v1="v"><MyVal v1="g"><MyVal v1="j"></ROOT>I need th resultsetabcduvgjhow to get this? using xpath?thankssubha |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-09-27 : 07:55:09
|
Like this:SELECT c.query('data(@v1)') AS v1FROM t1 CROSS APPLY xml1.nodes('/ROOT/MyVal') t2(c); |
|
|
|
|
|