次の方法で共有


Quoi de neuf pour XML dans SQL Server 2008 ?

C'est résumé dans un excellent livre blanc que vous trouverez ici : https://www.microsoft.com/sqlserver/2008/en/us/wp-sql-2008-whats-new-xml.aspx 

image

En voici le résumé :

  • The Evolution of SQL Server XML Capabilities

    • XML Functionality in SQL Server 2000

    • XML Functionality in SQL Server 2005

    • XML Functionality in SQL Server 2008

  • XML Schema Validation Enhancements

    • Lax Validation Support

    • Full xs:datetime Support

    • Union and List Types

  • XQuery Enhancements

    • support for the let clause

SELECT @x.query( '<Orders> {

       for $invoice in /Invoices/Invoice

       let $count :=count($invoice/Items/Item)

order by $count

return

<Order> {$invoice/Customer}

           <ItemCount>{$count}</ItemCount>

</Order>

}

</Orders>')

  • XML DML Enhancements

    • support the XML DML expressions insert

DECLARE @newBike xml

SET @newBike = '<Bike>Racing Bike</Bike>'

SET @productList.modify

('insert sql:variable("@newBike") as last into (/Products)[1]')

image