I get sulky when...
May. 25th, 2006 03:19 pmI'm in training at the moment on SQL server. I'm sulky at the moment too. Why? The trainer asked a question with what I thought was an obvious answer. I answered and was told I was wrong. Lots of other people answered and they were wrong too. When she told us the answer I discovered that I was actually right, she just hadn't quite understood what I said. This has made me sulky. On the other hand though I can be amused because I think I might understand this part of the course better than the trainer. Certainly soem of the explanations have been a little unclear in my mind.
Ah, well. Back to the training....
Edit:
The question was as follows (this is an abdridged version but keeps the core facts). For those that care I'm doing MS course 2779A.
I have the following XML:
I then do the following SQL:
Why do I not need to specify where Quantity gets its value from as I did for InvoiceID and ProductID?
Second edit: Explain in the above SQL what the '/SalesInvoice/Items/Item' means. The trainer did so *very* badly in my view and I want to see if those who know (probably Dave mainly) can explain better. :) Those who don't know are welcome to guess if they want. They are allowed to ask what the recordset returned looks like too if they want though.
Ah, well. Back to the training....
Edit:
The question was as follows (this is an abdridged version but keeps the core facts). For those that care I'm doing MS course 2779A.
I have the following XML:
<?xml version="1.0" ?>
<SalesInvoice InvoiceID="1000" CustomerID="123" OrderDate="2004-03-07">
<Items>
<Item ProductCode="12" Quantity="2" UnitPrice="12.99">aaa<ProductName>Bike</ProductName></Item>
<Item ProductCode="41" Quantity="1" UnitPrice="17.45">bbb<ProductName>Helmet</ProductName></Item>
<Item ProductCode="2" Quantity="1" UnitPrice="2.99">ccc<ProductName>Water Bottle</ProductName></Item>
</Items>
</SalesInvoice>
I then do the following SQL:
SELECT * FROM
OPENXML(@docHandle, '/SalesInvoice/Items/Item', 1)
WITH
(InvoiceID int '../../@InvoiceID',
ProductID int '@ProductCode',
Quantity int
)
Why do I not need to specify where Quantity gets its value from as I did for InvoiceID and ProductID?
Second edit: Explain in the above SQL what the '/SalesInvoice/Items/Item' means. The trainer did so *very* badly in my view and I want to see if those who know (probably Dave mainly) can explain better. :) Those who don't know are welcome to guess if they want. They are allowed to ask what the recordset returned looks like too if they want though.
(no subject)
Date: 2006-05-25 03:08 pm (UTC)That reminds me, I should hop down to the beer festival tomorrow evening, really.