Mike Eghtebas
asked on
XML Description
Customer Table SalesOrderHeader Table
============== ==============
CustomerId [SalesOrderID]
[AccountNumber] [CustomerID]
[TerritoryID] [OrderDate]
[SubTotal]
Below, there are 8 xml presentations (XML_A, XML_B,...XML_H). Only XML_A has a description as shown below.
Question: Could you please provide the description for each of XML_B, XML_C, ..., XML_H?
I have the description for XML_A shown below. I need a similar description for each of XML_B, XML_C, ..., XML_H below:.
XML_A: display rows from the SalesOrderHeader table for the Customer row
XML_B: >>> You provide the description<<<
XML_C: >>> You provide the description<<<
XML_D: >>> You provide the description<<<
XML_E: >>> You provide the description<<<
XML_F: >>> You provide the description<<<
XML_G: >>> You provide the description<<<
XML_H: >>> You provide the description<<<
And, just in case you were interested in the queries generating the above XMLs see below:
============== ==============
CustomerId [SalesOrderID]
[AccountNumber] [CustomerID]
[TerritoryID] [OrderDate]
[SubTotal]
Below, there are 8 xml presentations (XML_A, XML_B,...XML_H). Only XML_A has a description as shown below.
Question: Could you please provide the description for each of XML_B, XML_C, ..., XML_H?
I have the description for XML_A shown below. I need a similar description for each of XML_B, XML_C, ..., XML_H below:.
XML_A description: display rows from the SalesOrderHeader table for the Customer row
=====================================
<row SalesOrderID="43793" OrderDate="2011-06-21T00:00:00" SubTotal="3399.9900" AccountNumber="AW00011000" TerritoryID="9" />
<row SalesOrderID="51522" OrderDate="2013-06-20T00:00:00" SubTotal="2341.9700" AccountNumber="AW00011000" TerritoryID="9" />
<row SalesOrderID="57418" OrderDate="2013-10-03T00:00:00" SubTotal="2507.0300" AccountNumber="AW00011000" TerritoryID="9" />
XML_B: >>> display what.... (You provide the description for this XML)<<<
=====================================
<row>
<SalesOrderID>43793</SalesOrderID>
<OrderDate>2011-06-21T00:00:00</OrderDate>
<SubTotal>3399.9900</SubTotal>
<AccountNumber>AW00011000</AccountNumber>
<TerritoryID>9</TerritoryID>
</row>
<row>
<SalesOrderID>51522</SalesOrderID>
<OrderDate>2013-06-20T00:00:00</OrderDate>
<SubTotal>2341.9700</SubTotal>
<AccountNumber>AW00011000</AccountNumber>
<TerritoryID>9</TerritoryID>
</row>
<row>
<SalesOrderID>57418</SalesOrderID>
<OrderDate>2013-10-03T00:00:00</OrderDate>
<SubTotal>2507.0300</SubTotal>
<AccountNumber>AW00011000</AccountNumber>
<TerritoryID>9</TerritoryID>
</row>
XML_C: >>> display what.... (You provide the description for this XML)<<<
=====================================
<o SalesOrderID="43793" OrderDate="2011-06-21T00:00:00" SubTotal="3399.9900">
<c AccountNumber="AW00011000" TerritoryID="9" />
</o>
<o SalesOrderID="51522" OrderDate="2013-06-20T00:00:00" SubTotal="2341.9700">
<c AccountNumber="AW00011000" TerritoryID="9" />
</o>
<o SalesOrderID="57418" OrderDate="2013-10-03T00:00:00" SubTotal="2507.0300">
<c AccountNumber="AW00011000" TerritoryID="9" />
</o>
XML_D: >>> display what.... (You provide the description for this XML)<<<
=====================================
<o>
<SalesOrderID>43793</SalesOrderID>
<OrderDate>2011-06-21T00:00:00</OrderDate>
<SubTotal>3399.9900</SubTotal>
<c>
<AccountNumber>AW00011000</AccountNumber>
<TerritoryID>9</TerritoryID>
</c>
</o>
<o>
<SalesOrderID>51522</SalesOrderID>
<OrderDate>2013-06-20T00:00:00</OrderDate>
<SubTotal>2341.9700</SubTotal>
<c>
<AccountNumber>AW00011000</AccountNumber>
<TerritoryID>9</TerritoryID>
</c>
</o>
<o>
<SalesOrderID>57418</SalesOrderID>
<OrderDate>2013-10-03T00:00:00</OrderDate>
<SubTotal>2507.0300</SubTotal>
<c>
<AccountNumber>AW00011000</AccountNumber>
<TerritoryID>9</TerritoryID>
</c>
</o>
XML_E: >>> display what.... (You provide the description for this XML)<<<
=====================================
<c AccountNumber="AW00011000" TerritoryID="9">
<o SalesOrderID="43793" OrderDate="2011-06-21T00:00:00" SubTotal="3399.9900" />
<o SalesOrderID="51522" OrderDate="2013-06-20T00:00:00" SubTotal="2341.9700" />
<o SalesOrderID="57418" OrderDate="2013-10-03T00:00:00" SubTotal="2507.0300" />
</c>
XML_F: >>> display what.... (You provide the description for this XML)<<<
=====================================
<c AccountNumber="AW00011000" TerritoryID="9">
<o SalesOrderID="43793" OrderDate="2011-06-21T00:00:00" SubTotal="3399.9900" />
<o SalesOrderID="51522" OrderDate="2013-06-20T00:00:00" SubTotal="2341.9700" />
<o SalesOrderID="57418" OrderDate="2013-10-03T00:00:00" SubTotal="2507.0300" />
</c>
XML_G: >>> display what.... (You provide the description for this XML)<<<
=====================================
<Sales.Customer Name="AW00011000" Country="9">
<SalesOrderID>43793</SalesOrderID>
<OrderDate>2011-06-21T00:00:00</OrderDate>
<SubTotal>3399.9900</SubTotal>
</Sales.Customer>
<Sales.Customer Name="AW00011000" Country="9">
<SalesOrderID>51522</SalesOrderID>
<OrderDate>2013-06-20T00:00:00</OrderDate>
<SubTotal>2341.9700</SubTotal>
</Sales.Customer>
<Sales.Customer Name="AW00011000" Country="9">
<SalesOrderID>57418</SalesOrderID>
<OrderDate>2013-10-03T00:00:00</OrderDate>
<SubTotal>2507.0300</SubTotal>
</Sales.Customer>
XML_H: >>> display what.... (You provide the description for this XML)<<<
=====================================
<Customers>
<Customer>
<Name>AW00011000</Name>
<Country>9</Country>
</Customer>
<SalesOrderID>43793</SalesOrderID>
<OrderDate>2011-06-21T00:00:00</OrderDate>
<SubTotal>3399.9900</SubTotal>
</Customers>
<Customers>
<Customer>
<Name>AW00011000</Name>
<Country>9</Country>
</Customer>
<SalesOrderID>51522</SalesOrderID>
<OrderDate>2013-06-20T00:00:00</OrderDate>
<SubTotal>2341.9700</SubTotal>
</Customers>
<Customers>
<Customer>
<Name>AW00011000</Name>
<Country>9</Country>
</Customer>
<SalesOrderID>57418</SalesOrderID>
<OrderDate>2013-10-03T00:00:00</OrderDate>
<SubTotal>2507.0300</SubTotal>
</Customers>
XML_A: display rows from the SalesOrderHeader table for the Customer row
XML_B: >>> You provide the description<<<
XML_C: >>> You provide the description<<<
XML_D: >>> You provide the description<<<
XML_E: >>> You provide the description<<<
XML_F: >>> You provide the description<<<
XML_G: >>> You provide the description<<<
XML_H: >>> You provide the description<<<
And, just in case you were interested in the queries generating the above XMLs see below:
Use AdventureWorks2014
GO
SELECT
[CustomerID] --CustomerId
,[AccountNumber] --Name
,[TerritoryID] --Country
FROM [Sales].[Customer]
SELECT
[SalesOrderID] --OrderId
,[CustomerID] --CustomerId
,[OrderDate] --OrderDate
,[SubTotal] --Amount
FROM [Sales].[SalesOrderHeader]
--xml_A
Select [SalesOrderID], OrderDate
, [SubTotal], c.[AccountNumber], c.[TerritoryID]
From [Sales].[SalesOrderHeader] o inner join [Sales].[Customer] c
on o.[CustomerID]=c.[CustomerID]
Where c.[CustomerID]=11000
for xml raw;
--xml_B
Select [SalesOrderID], OrderDate
, [SubTotal], c.[AccountNumber], c.[TerritoryID]
From [Sales].[SalesOrderHeader] o inner join [Sales].[Customer] c
on o.[CustomerID]=c.[CustomerID]
Where c.[CustomerID]=11000
for xml raw, elements;
--xml_C
Select [SalesOrderID], OrderDate
, [SubTotal], c.[AccountNumber], c.[TerritoryID]
From [Sales].[SalesOrderHeader] o inner join [Sales].[Customer] c
on o.[CustomerID]=c.[CustomerID]
Where c.[CustomerID]=11000
for xml Auto;
--xml_D
Select [SalesOrderID], OrderDate
, [SubTotal], c.[AccountNumber], c.[TerritoryID]
From [Sales].[SalesOrderHeader] o inner join [Sales].[Customer] c
on o.[CustomerID]=c.[CustomerID]
Where c.[CustomerID]=11000
for xml Auto, elements;
--xml_E
Select c.[AccountNumber], c.[TerritoryID]
, o.[SalesOrderID], o.[OrderDate], o.[SubTotal]
From [Sales].[SalesOrderHeader] o inner join [Sales].[Customer] c
on o.[CustomerID]=c.[CustomerID]
Where c.[CustomerID]=11000
for xml Auto;
--xml_F
Select c.[AccountNumber], c.[TerritoryID]
, [SalesOrderID], OrderDate, [SubTotal]
From [Sales].[SalesOrderHeader] o inner join [Sales].[Customer] c
on o.[CustomerID]=c.[CustomerID]
Where c.[CustomerID]=11000
for xml Auto;
--xml_G
Select c.[AccountNumber] AS '@Name', c.[TerritoryID] As '@Country'
, [SalesOrderID], OrderDate, [SubTotal]
From [Sales].[SalesOrderHeader] o inner join [Sales].[Customer] c
on o.[CustomerID]=c.[CustomerID]
Where c.[CustomerID]=11000 for xml Path('Sales.Customer');
--xml_H
Select c.[AccountNumber] AS 'Customer/Name', c.[TerritoryID] As 'Customer/Country'
, [SalesOrderID], OrderDate, [SubTotal]
From [Sales].[SalesOrderHeader] o inner join [Sales].[Customer] c
on o.[CustomerID]=c.[CustomerID]
Where c.[CustomerID]=11000 for xml Path('Customers');
ASKER
This is an existing QA. for more see: (The attached doc file has the same info.)
XML_A_B_Question_EE.docx
XML_A_B_Question_EE.docx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nakul,
I am grateful for the time and effort you put on this. It is really helpful.
Just to let you know XML_F is not included yet.
Mike
I am grateful for the time and effort you put on this. It is really helpful.
Just to let you know XML_F is not included yet.
Mike
ASKER
Thank you very much.
I guess I am having a hard time understanding the need for the XML descriptions. Are you trying to develop some interface on the AdventureWorks schema as a sample for some team to use?