Monday, December 3, 2007

How do I access SQL Server From the Browser

How do I access SQL Server From the Browser

Access SQL Server from browser can be done through Configure XML Support for SQL Server.

Step 1

To start XML Support for MSSQL Server, go to Program Files , select MS SQL Server and choose Configure XML Support for SQL Server.

Step 2

Enter Northwind as the virtual directory name. It can be any other name. Provide the path where the virtual directory will be placed.

Step 3

Please note that the name Northwind must be the same as the one that you will be using to pass the query to. Next click on Security Tab

Step 4

We will use SQL server SA to login to SQL Server. Click on Data Source tab.

Step 5

Under the Database section, choose Northwind as the database.

Step 6

Next click on Settings tab. Check Allow URL queries, Allow template queries, Allow Xpath, Allow Post.

Step 7

Under the define virtual names, click on New

Then setup 2 object here which is the schema and dboject.

Step 8

First select Schema and then provide the path to it. We will use a schema folder under Nwind folder.

Step 9

Click Save.

Step 10

Next we will setup DBOBJECT.

Step 11

Click Save and Apply when done. The newly created virtual directory will look something like this.

Step 12

To test it, open up your IE browser and then pass the following string over to it.

http://compact/northwind?sql=SELECT+*+FROM+Employees+FOR+XML+AUTO&root=root

No comments: