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 |
chennaraaj
Starting Member
17 Posts |
Posted - 2013-12-20 : 06:27:11
|
Hi All, I am having Test table with (id int , DataDescription xml) . I need to read the values from DataDescription column and insert into one tableregardsrk |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-12-20 : 10:31:56
|
Post a representative sample of the data from the DataDescription column, and the values/columns you want to extract from it.Typically you would query the XML to get the values via a select query which makes use of XML nodes function, and value and/or query functions. But, how you would write that largely depends on the nature of the XML data. Hence the need for a sample. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-12-21 : 00:52:56
|
Something like thisINSERT Table2SELECT t.u.value('ElementName','datatype'),...FROM Table1 tCROSS APPLY DataDescription.nodes('/<RootNodeName>/<FullPathOfNodes>')t(u) the root name element name etc will depend on your actual xml value. if you can post a sample value we cant help out with actual query.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
|
|
|