Customer:
Notice that the select XPath expression in the xsl:for-each tag is set to Northwind/Customers Northwind is the root node from the generated XML, and Customers are the child nodes from the root Therefore, this XPath expression selects all the Customers nodes from any XML generated by SQL Server Listing 16.14 shows an XML file named CustomersUsingStylesheet.xml, which uses the CustomersStylesheet.xsl file CustomersUsingStylesheet.xml retrieves the top two rows from the Customers table Listing 16.14: CUSTOMERSUSINGSTYLESHEET.XML SELECT TOP CustomerID, CompanyName, PostalCode, Country, Phone FROM Customers ORDER BY CustomerID FOR XML AUTO, ELEMENTS To run the CustomersUsingStylesheet.xml file, point your browser to the following URL: http://localhost/Northwind/Templates/CustomersUsingStylesheet.xml?contenttype= text/html Notice that the contenttype parameter at the end of this URL is set to text/html, which indicates that the content is to be interpreted as HTML Warning If you omit the contenttype parameter, then you'll get the following error: End tag 'HEAD' does not match the start tag 'META' Figure 16.16 shows the result of running the CustomersUsingStylesheet.xml file in IE Notice that the output is formatted using the rules defined in the CustomersStylesheet.xsl file Figure 16.16: Running the CustomersUsing-Stylesheet xml file ... Directory Management for SQL Server console Running Direct SQL Statements Using a Browser In this section, you''ll learn how to run direct SQL statements using a browser I''ll be using Internet Explorer... Create it using Windows Explorer, and then browse to that directory using the Browse button Next, you use the Security tab to set the details of how to authenticate the user when accessing SQL Server. .. stored procedure Running SQL Statements Using an XML Template You can also execute SQL statements using an XML template, which is just an XML file containing your embedded SQL statement Listing