views:

17

answers:

0

I'm hoping you can help me narrow my research on how to "modernize" my use of SQL XML...

I recently "dusted off" a bit of something I cobbled together several years ago. It utilizes something called SQLXML 3.0 and IIS Virtual Directory Management for SQLXML 3.0 resulting in an XML template that contains a SQL EXECUTE of a stored procedure.

The sProc in turn joins some tables and uses the FOR XML AUTO clause to return XML (this was originally developed in SQL Server 2000.

The demo application can be reached at: http://gis.cbmiweb.com/gmaps_v1/opedemo.aspx where you'll see the goal is to process the returned XML and place markers on a map using the Google Maps API.

As I look at this whole thing now, the configuration bits done on my IIS server resulting in this below seem very "awkward":

<?xml version="1.0" encoding="UTF-8"?>
<flasInfo xmlns:sql="urn:schemas-microsoft-com:xml-sql">
 <sql:header>
      <sql:param name="AreaID"></sql:param>
      <sql:param name="Scramble"></sql:param>
 </sql:header>
 <sql:query>
   EXECUTE dbo.FLAS_List_Awards_V1 @AreaID, @Scramble
 </sql:query>

Here is the key bit inside the Javascript (I think much of this would need to remain as is...):

  var urlBase = "../FLAS/template/spGetAwardsV2.xml?AreaID="
  var parmTemplate = <% = SelectedArea.AreaID %>;
  var scramble = "&Scramble=";                          // just causes sProc to "scramble" award numbers
  var parmScramble = <% = DataStyle %>;
  var tableColor = document.getElementById("tableMain")
  if ( parmScramble == 1 ) {tableColor.style.backgroundColor= "navy";}
  var urlRequest = urlBase + parmTemplate + scramble + parmScramble;
  // alert ("urlRequest value = " + urlRequest);
    // Read the data from example.xml:
  var request = GXmlHttp.create();
  request.open("GET", urlRequest, true);
  request.onreadystatechange = function() {
    if (request.readyState == 4) {
      var xmlDoc = request.responseXML;
      var markers = xmlDoc.documentElement.getElementsByTagName("marker");

Now the database has been upgraded to SQL 2008 and I have installed Visual Studio 2008 SP1 but my knowledge of SQLXML is currently stuck around year 2004! Where would you recommend I start reading/looking to best exploit the newer technologies?