![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, Sorry if this is a simplistic question but I'm having trouble using FOR XML AUTO in a DTS package created using the DTS Export wizard in SQL Server 2000. My SQL is : Select rtrim(col1) as c1, rtrim(col2) as c2, rtrim(col3) as c3 from table1 for XML AUTO and I'm outputting to a file, called say test.xml The output always comes out in some kind of binary format but I want it in XML format. What am I doing wrong ? If I execute the SQL in Enterprise manager I get the output as <long text>, but not if I put : Select rtrim(col1) as c1, rtrim(col2) as c2, rtrim(col3) as c3 from table1 for XML AUTO this gives XML (but not when I use it in the DTS wizard) If I can't output XML to file, can someone tell me what type of binary format SQL server stores output in so that I can attempt to decode it ? Thanks Dave |
#3
| |||
| |||
|
|
In article <ac73af15b2d7864c964e44e87aadd34c (AT) news (DOT) teranews.com>, Dave S dave_xxx70 (AT) hotmail (DOT) com> writes Hi, Sorry if this is a simplistic question but I'm having trouble using FOR XML AUTO in a DTS package created using the DTS Export wizard in SQL Server 2000. My SQL is : Select rtrim(col1) as c1, rtrim(col2) as c2, rtrim(col3) as c3 from table1 for XML AUTO and I'm outputting to a file, called say test.xml The output always comes out in some kind of binary format but I want it in XML format. What am I doing wrong ? If I execute the SQL in Enterprise manager I get the output as <long text>, but not if I put : Select rtrim(col1) as c1, rtrim(col2) as c2, rtrim(col3) as c3 from table1 for XML AUTO this gives XML (but not when I use it in the DTS wizard) If I can't output XML to file, can someone tell me what type of binary format SQL server stores output in so that I can attempt to decode it ? Thanks Dave Simple answer, this doesn't work. Very annoying and frustrating, and I have tried many times, but Dts just doesn't like the xml stream. Try this- http://www.sqlxml.org/faqs.aspx?faq=10 You can change it slightly and stream directly into a file stream rather than all into memory and the Dom. You can also loose the template query as well and just use a normal text command or stored procedure instead. This is all just normal ADO stuff really, so if you use FOR XML and the stream output from the ADO Command Execute elsewhere in your apps it should make sense. -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org |
![]() |
| Thread Tools | |
| Display Modes | |
| |