SQL Server Performance

XQuery tuning

Discussion in 'SQL Server 2005 General Developer Questions' started by gryphonsclaw78, Jul 1, 2009.

  1. gryphonsclaw78 New Member

    I am looking to bring back 2 attributes that can be in any element. Currently, I am running a x.query() for each attribute I am looking for.
    Is there a way to do this in one query? Looking at the execution plan, each XML Reader table is taking 28% of the total process.
    Such as:
    SELECT myXMLcol.query('fn:data(//s2sBody//@dateTime)').value('.','varchar(MAX)') as test,
    myXMLcol.query('fn:data(//s2sBody//@TTL)').value('.','varchar(MAX)') as test
    FROM myXMLTable
  2. satya Moderator

Share This Page