Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Retrieving XML Documents Using FOR XML

SQL Server 2000

  New Information - SQL Server 2000 SP3.

You can execute SQL queries against existing relational databases to return results as XML documents rather than as standard rowsets. To retrieve results directly, use the FOR XML clause of the SELECT statement, and within the FOR XML clause, specify one of these XML modes:

  • RAW

  • AUTO


These modes are in effect only for the execution of the query for which they are set. They do not affect the results of any subsequent queries. In addition to specifying the XML mode, you can also request the XML-Data schema.

Security Note  Support for this XML functionality has been enhanced in the Web releases of Microsoft® SQLXML. For the latest enhancements, install Microsoft SQLXML 3.0 Service Pack 1 from this Microsoft Web site. The documentation that accompanies this service pack provides security considerations for developing applications.

See Also

Executing Template Files Using a URL


© 2015 Microsoft