A SIMPLE XML EXTRACT USING SQL SERVER 2000
"SELECT...FOR XML AUTO"
 
 

The SQL connection string is ="SELECT * from glmaster FOR XML AUTO"

Note: The connection is OLEDB NOT DSN.

MS SQL Server 2000 returns 1 nested tag per table row where:

  1. the outside tag is the table name
  2. each table row's "SELECTED" columns appears as a tag pair with the column data as content
  3. there is NO overall outside tag
    (Note: You have to add one to use the XML DOM on the client side)

The XML is returned to the client as an XML data island and rolled out through javascript using the XML DOM.
NOTE: The roll out is not recursive since the "XML AUTO" will only return two levels.

Click "VIEW", then "SOURCE" to see the XML data island and the javascript XMLDOM rollout Execution begins...

Click here for the source code