Hi,
For reasons beyond the scope of this question, i need to insert into a
varchar field of a table, the output of a select * from table2 for xml auto,
elements .
I haven't figured out a way to do this. any ideas?
thanksHello Ishmael,
> For reasons beyond the scope of this question, i need to insert into a
> varchar field of a table, the output of a select * from table2 for xml
> auto, elements . I haven't figured out a way to do this. any ideas?
If you are using SQL Server 2000, you'll need to do this via a round trip
due to the way that the XML Aggregator works -- have some client fetch the
XML and then insert it into the target table column. If you are using SQL
Server 2005, it's pretty easy:
insert into schema.tabke values (xmlCol)
select ... for xml auto,elements
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/
Showing posts with label beyond. Show all posts
Showing posts with label beyond. Show all posts
Friday, March 9, 2012
For xml into insert
Hi,
For reasons beyond the scope of this question, i need to insert into a
varchar field of a table, the output of a select * from table2 for xml auto,
elements .
I haven't figured out a way to do this. any ideas?
thanks
Hello Ishmael,
> For reasons beyond the scope of this question, i need to insert into a
> varchar field of a table, the output of a select * from table2 for xml
> auto, elements . I haven't figured out a way to do this. any ideas?
If you are using SQL Server 2000, you'll need to do this via a round trip
due to the way that the XML Aggregator works -- have some client fetch the
XML and then insert it into the target table column. If you are using SQL
Server 2005, it's pretty easy:
insert into schema.tabke values (xmlCol)
select ... for xml auto,elements
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/
For reasons beyond the scope of this question, i need to insert into a
varchar field of a table, the output of a select * from table2 for xml auto,
elements .
I haven't figured out a way to do this. any ideas?
thanks
Hello Ishmael,
> For reasons beyond the scope of this question, i need to insert into a
> varchar field of a table, the output of a select * from table2 for xml
> auto, elements . I haven't figured out a way to do this. any ideas?
If you are using SQL Server 2000, you'll need to do this via a round trip
due to the way that the XML Aggregator works -- have some client fetch the
XML and then insert it into the target table column. If you are using SQL
Server 2005, it's pretty easy:
insert into schema.tabke values (xmlCol)
select ... for xml auto,elements
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/
Subscribe to:
Posts (Atom)