Results 1 to 2 of 2

Thread: IIS Queries

  1. #1
    Join Date
    May 2005
    Location
    Morgan Hill, CA
    Posts
    1

    MS-SQL / IIS: IIS Queries

    I need to do some web queries against the SQL Server (MS SQL 2000). I'm currently using templates, with stored procedures using "for XML...".

    What are the relative merits of using templates and stored procedures, vs. templates and mapping schema queries... my gut feeling is that schema queries may be more work initially (to write the XSD w/ schema mapping), but more powerful and flexible in the longer run. Also, how will this play into Yukon?

    A couple more questions: my primary reference for most of this is Graeme Malcom's "SQL Server 2000 with XML".... I can't seem to find much more better info on Microsoft's site... any recommendations on additional resources?

    And finally: One *perceived* advantage of using stored procedures with "for XML" is the ability to create "computed columns" - e.g. if I need the Extended Price, I can multiply (QtyOrdered * Price) and return that as a column in the XML result set. That doesn't seem to be possible with the mapping schema method (or maybe I just don't understand how to do it...). I couldn't find any references to this in Graeme's book or any MS docs - the schema appears to be a one-to-one mapping strictly against the database columns. I guess I can use an "interface" view to get the additional columns I want...

    Thanks in advance for your opinions and guidance.
    Last edited by JamesHaskell; 05-09-2005 at 01:37 PM.

  2. #2
    Join Date
    Feb 2003
    Posts
    1,048
    One advantage of using stored procedures is performance. Stored procedures get compiled by SQL Server and compiled code always runs faster than non-compiled code. Also, execution plans for stored procedures stay in memory longer than for ad hoc queries.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •