From varchar(max) to xml



I have a table with 2 columns. Column a(varchar(max)) and column b(xml).
Column a contains the following data:

Col1;Col2
New York;USA
Rio;Brasil
Tokio;Japan

The first line contains the column header, the following the data.

The data should be transferred to column b with the following xml-structure:

<Col1>New York</Col1><Col2>USA</Col2>
<Col1>Rio</Col1><Col2>Brasil</Col2>
<Col1>Tokio</Col1><Col2>Japan</Col2>

The number of columns and the column names are various.

Any ideas?

Thanks psychodad71

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-xml/200606/1
.


Loading