EXPERT RESPONSE
The output of Select For XML Explicit can be voluminous. SQL Query analyzer doesn't do a great job of presenting the output of For XML queries. For the best results use the menu command Tools -> Options. On the Results tab change the "Maximum characters per column" to 8192. Then use the menu command Query -> Result in Text (Ctrl+T). These options give you the best XML output from Query Analyzer.
Even better than Query Analyzer's output is a utility that I wrote to allow experimentation with For XML queries as Appendix C of the book SQL Server 2000 XML Distilled. The code is in the book's download. The original version of the utility is in Visual Basic 6. I've also written a C# version of the utility, which is available on my Web site.
Do you have comments on this Ask the Expert Q&A? Let us know.
|