Creating the nwind Virtual Directory

XML and Internet Support

XML and Internet Support

Creating the nwind Virtual Directory

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

  1. In the Microsoft SQL Server program group, click Configure SQL XML Support in IIS.

  2. Expand a server, and then click the Web site you want.

  3. 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.

  4. 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.

  5. On the Security tab, select SQL Server and enter the valid SQL Server login information. When you go to the next tab, you will be asked to confirm the password you just entered.

  6. 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.

  7. On the Settings tab, select the Allow URL queries, Allow template queries, Allow XPath, and Allow POST options.

  8. 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.
  9. 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.
  10. 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.
  11. 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.

See Also

Using IIS Virtual Directory Management for SQL Server Utility