SQL Server 2000 支援透過 HTTP 進行資料存取,前須使用「SQL Server 的 IIS 虛擬目錄管理實用工具」建立虛擬根目錄。
https://IISServer/nwind?sql=SELECT+*+FROM+Customers+FOR+XML+AUTO&root=rootFOR XML 子句以 XML 格式回傳,root 參數指定單一根元素。https://IISServer/nwind?template=<ROOT+xmlns:sql="urn:schemas-microsoft-com:xml-sql"><sql:query>SELECT+*+FROM+Customers+FOR+XML+AUTO</sql:query></ROOT>https://IISServer/nwind/TemplateVirtualName/templatefile.xmlTemplateVirtualName 為虛擬目錄管理工具建立的 template 類型虛擬名稱。https://IISServer/nwind/SchemaVirtualName/schemafile.xml/Customer[@CustomerID="ALFKI"]SchemaVirtualName 為 schema 類型虛擬名稱,後接 XPath 查詢。https://IISServer/nwind/dbobjectVirtualName/XpathQuerydbobjectVirtualName 為 dbobject 類型虛擬名稱。root 參數時,回傳完整 XML 文件 (單一根元素)。<ROOT> 標籤提供根元素。root 參數時回傳 XML 文件片段 (無根元素、無標頭)。當 URL 執行需資源的操作 (建立暫存表/程序、宣告游標、執行sp_xml_preparedocument等) 時,必須執行對應釋放命令 (DROP TABLE、DEALLOCATE、sp_xml_removedocument等) 以免資源洩漏。
於執行「在 IIS 中設定 SQL XML 支援」建立虛擬目錄,指定 IIS 伺服器名稱、虛擬目錄名稱、登入資訊與存取權限,以建立與特定資料庫的連線。
Template.xml)URL 中的虛擬名稱類型決定檔案類型與處理方式。