Generating XML from SQL Queries

SQL Server allows you to access its data via a uniform resource locator (URL) over HTTP. The query looks like this:

http://YourServerName/CustomerData?sql=SELECT+*+FROM+Customers+FOR+XML+AUTO

NOTE

You must replace the reference to YourServerName with the name of your server.

Before you can run such a query, you must first set up Internet Information Server (IIS) to accept a URL.

Setting Up IIS for SQL Server

Several steps must be fastidiously followed before you can submit a URL request to SQL Server:

1.
Create a folder named Customers in your \Inetpub\wwwroot directory.
2.
Add two subdirectories, one called template and the other called schema.
3.
From the Windows Start menu, select Start, Programs, SQL Server, ...

Get Alison Balter's Mastering Access 2002 Enterprise Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.