devxlogo

Retrieve SQL Server Results in XML through an HTTP Connection

Retrieve SQL Server Results in XML through an HTTP Connection

Beginning with SQL Server 2000, Microsoft added support to retrieve data from SQL Server databases by using an URL address. To do this, you must create a virtual root, that is, a virtual address that your Website visitors can see. To do that, use the ‘Configure SQL XML Support in IIS’ utility that comes with the SQL Server 2000 installation. Then, you can send queries by URL.
Example:
‘http://myWebServerName/myVirtualRootName?sql=SELECT+FirstName+FROM+Employees’
The results are in XML format, so there’s no ASP needed. The ‘+’ signs exist to substitute the normal spaces that, as you know, are forbidden from usage in URL addresses. Enjoy!

devx-admin

Share the Post: