Creating the nwind Virtual Directory
New Information - SQL Server 2000 SP3.
This example creates the nwind virtual directory. The nwind virtual directory is used in most of the examples that are used to illustrate URL access to Microsoft® SQL Server™ 2000.
Before you create the nwind virtual directory, you need a physical directory associated with the virtual directory that you are creating (for example, C:\Inetpub\Wwwroot\nwind where nwind is the physical directory associated with the nwind virtual directory that is created in the following procedure).
You also need to create two subdirectories in the physical directory associated with the virtual directory (for example, C:\Inetpub\Wwwroot\nwind\template, and C:\Inetpub\Wwwroot\nwind\schema). These are the directories associated with the virtual names of template and schema types that are created as part of creating nwind virtual directory.
To create the nwind virtual directory
- In the Microsoft SQL Server program group, click Configure SQL XML Support in IIS.
- Expand a server, and then click the Web site you want.
- On the Action menu, point to New, and then click Virtual Directory. The property page for the new virtual directory is displayed on the screen.
- On the General tab of the New Virtual Directory Properties dialog box, enter the name of the virtual directory. For this example, type nwind and the physical directory path (for example, C:\Inetpub\Wwwroot\nwind, assuming you have a subdirectory nwind created in the C:\Inetpub\Wwwroot directory). You can optionally use the Browse button to select the directory.
- On the Security tab, select SQL Server and Use Windows Integration Authentication.
- On the Data Source tab, in the SQL Server box, enter the name of a server, for example (local), and optionally, the name of an instance of SQL Server 2000 if more than one instance is installed on the specified computer. In the Database box, enter Northwind as the name of the default database.
- On the Settings tab, select the Allow URL queries, Allow template queries, Allow XPath, and Allow POST options.
- On the Virtual Names tab, click New to create the virtual name for the template type.
In the Virtual Name Configuration dialog box:
- Enter template in the Virtual name box (it can be any user specified name). In the Type list, select template. Enter the path (for example, C:\Inetpub\Wwwroot\nwind\template, assuming there is a subdirectory template in the physical directory associated with the virtual directory, however the existence of the path is not checked). Click Save to save the virtual name.
- On the Virtual Names tab, click New to create the virtual names for the schema type.
- Enter schema in the Virtual name box (it can be any user specified name). In the Type list, select schema. Enter the path (for example, C:\Inetpub\Wwwroot\nwind\schema, assuming there is a subdirectory schema in the physical directory associated with the virtual directory). Click the Save button to save the virtual name.
- On the Virtual Names tab, click New to create the virtual names for the template and schema types.
- Enter dbobject in the Virtual name box (it can be any user specified name). In the Type list, select dbobject. Click the Save button to save the virtual name.
- Click OK to save the settings.
This creates a virtual directory nwind. The queries specified using this virtual directory are, by default, executed against the Northwind database.
To test the virtual directory, in the browser type: http://<IISServer>/nwind?sql=SELECT * FROM Employees FOR XML AUTO&root=root and press ENTER.