共用方式為


關於 ProductModel.CatalogDescription xml 資料行

以 Adventure Works 為例,腳踏車產品型號的型錄描述會以 XML 格式儲存在 CatalogDescription 資料行中。每一個產品型號都可包含數種個別的產品。例如,Road 450 是一個腳踏車產品型號,它包含了好幾種腳踏車,例如 Road 450 red 25Road 450 Green 48。在腳踏車產品型號之間的主要差異是在顏色及尺寸。

您可以查詢這些產品的描述,將 XSL 轉換套用到這些描述,進而產生線上型錄。儲存在 CatalogDescription 資料行中的型錄資訊不會使用業界標準的結構描述。因此,若有需要,您可以撰寫查詢來建立業界標準的 XML 產品型錄。

這是 xml 類型的資料行。您可以在 Microsoft 網站檢視此資料行所使用的結構描述。此資料行使用 AdventureWorksProductModelDescriptionProductModelWarrAndMain XML 結構描述。

XML 執行個體範例

這是儲存在 ProductModel.CatalogDescription 資料行中的 XML 執行個體範例:

<?xml-stylesheet href="ProductDescription.xsl" type="text/xsl"?>
<p1:ProductDescription xmlns:p1="https://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription" xmlns:wm="https://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelWarrAndMain" xmlns:wf="https://www.adventure-works.com/schemas/OtherFeatures" xmlns:html="http://www.w3.org/1999/xhtml" ProductModelID="19" ProductModelName="Mountain 100">
  <p1:Summary>
    <html:p>Our top-of-the-line competition mountain bike. Performance-enhancing options include the innovative HL Frame, super-smooth front suspension, and traction for all terrain.</html:p>
  </p1:Summary>
  <p1:Manufacturer>
    <p1:Name>AdventureWorks</p1:Name>
    <p1:Copyright>2002</p1:Copyright>
    <p1:ProductURL>HTTP://www.Adventure-works.com</p1:ProductURL>
  </p1:Manufacturer>
  <p1:Features>These are the product highlights. 
                 <wm:Warranty><wm:WarrantyPeriod>3 years</wm:WarrantyPeriod><wm:Description>parts and labor</wm:Description></wm:Warranty><wm:Maintenance><wm:NoOfYears>10 years</wm:NoOfYears><wm:Description>maintenance contract available through your dealer or any AdventureWorks retail store.</wm:Description></wm:Maintenance><wf:wheel>High performance wheels.</wf:wheel><wf:saddle><html:i>Anatomic design</html:i> and made from durable leather for a full-day of riding in comfort.</wf:saddle><wf:pedal><html:b>Top-of-the-line</html:b> clipless pedals with adjustable tension.</wf:pedal><wf:BikeFrame>Each frame is hand-crafted in our Bothell facility to the optimum diameter and wall-thickness required of a premium mountain frame. The heat-treated welded aluminum frame has a larger diameter tube that absorbs the bumps.</wf:BikeFrame><wf:crankset> Triple crankset; alumunim crank arm; flawless shifting. </wf:crankset></p1:Features>
  <!-- add one or more of these elements... one for each specific product in this product model -->
  <p1:Picture>
    <p1:Angle>front</p1:Angle>
    <p1:Size>small</p1:Size>
    <p1:ProductPhotoID>118</p1:ProductPhotoID>
  </p1:Picture>
  <!-- add any tags in <specifications> -->
  <p1:Specifications> These are the product specifications.
                   <Material>Almuminum Alloy</Material><Color>Available in most colors</Color><ProductLine>Mountain bike</ProductLine><Style>Unisex</Style><RiderExperience>Advanced to Professional riders</RiderExperience></p1:Specifications>
</p1:ProductDescription>

執行下列查詢以找到更多的 XML 執行個體:

SELECT CatalogDescription
FROM   Production.ProductModel

請參閱

概念

XML 應用程式範例

說明及資訊

取得 SQL Server 2005 協助