使用 Adventure Works 來說明零售商購買 Adventure Works Cycles 的產品,並將它們賣到零售商店。這些零售商的人口統計資訊 (例如年收入、年銷售額、商業類型以及已開業年數) 是儲存在 Store 資料表中 xml 資料類型的 Demographics 資料行中。
這是具類型的 xml 資料行。您可以在 Microsoft 網站檢視此資料行所使用的結構描述。此資料行使用 AdventureWorksStoreSurvey XML 結構描述。
XML 執行個體範例
這是儲存在 Store.Demographics 資料行中的 XML 執行個體範例:
<StoreSurvey xmlns="https://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey">
<AnnualSales>300000</AnnualSales>
<AnnualRevenue>30000</AnnualRevenue>
<BankName>International Bank</BankName>
<BusinessType>BM</BusinessType>
<YearOpened>1970</YearOpened>
<Specialty>Road</Specialty>
<SquareFeet>7000</SquareFeet>
<Brands>3</Brands>
<Internet>T1</Internet>
<NumberEmployees>2</NumberEmployees>
</StoreSurvey>
執行下列查詢以尋找更多的 XML 執行個體:
SELECT Demographics
FROM Sales.Store