Home arrow ASP arrow Page 2 - SQL Server 2000, XML and XSL: The Ultimate Combination
ASP

SQL Server 2000, XML and XSL: The Ultimate Combination


All the hype that once surrounded XML is finally starting to die down, and developers are really beginning to harness the power and flexibility of the language. In this article, Mitchell will show us how SQL Server 2000 incorporates XML support using the "FOR XML EXPLICIT" method to retrieve data from a table as a customised XML document.

Author Info:
By: Mitchell Harper
Rating: 5 stars5 stars5 stars5 stars5 stars / 21
January 07, 2002
TABLE OF CONTENTS:
  1. · SQL Server 2000, XML and XSL: The Ultimate Combination
  2. · Creating our sample database
  3. · Creating the stored procedure
  4. · Displaying the XML with ASP and XSL
  5. · Conclusion

print this article
SEARCH DEVARTICLES

SQL Server 2000, XML and XSL: The Ultimate Combination - Creating our sample database
(Page 2 of 5 )

On your SQL Server, open Enterprise Manager and create a new database named "myProducts". Then, using either Enterprise Manager or Query Analyzer, create the tables shown below:

The tables in our myProducts database

(Note: catId, productId and descId are all auto-incrementing identity fields)

As you've probably guessed, we're using three tables to simulate a very simple product description database (let's assume we sell books). The diagram above shows the hierarchy of our data: categories listing products, listing their descriptions. Before we progress to the next step, we'll need to create some dummy data in our tables. To maximize productivity and minimize the length of this article, I've created a simple T-SQL script, which will populate our tables as needed. You can download it as part of the support material at the end of this article. The script will create 3 categories, 7 products and 7 descriptions.
blog comments powered by Disqus
ASP ARTICLES

- Central Scoreboard with Flash and ASP
- Calorie Counter Using WAP and ASP
- Creating PGP-Encrypted E-Mails Using ASP
- Be My Guest in ASP
- Session Replacement in ASP
- Securing ASP Data Access Credentials Using t...
- The Not So Ordinary Address Book
- Adding and Displaying Data Easily via ASP an...
- Sending Email From a Form in ASP
- Adding Member Services in ASP
- Removing Unconfirmed Members
- Trapping HTTP 500.100 - Internal Server Error
- So Many Rows, So Little Time! - Case Study
- XDO: An XML Engine Class for Classic ASP
- Credit Card Fraud Prevention Using ASP and C...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials