Title: [OT] XPath in MS SQL
Yes, but that would be the same idea as what I had before, maybe even more resource hogging.
I really want to know if its possible to do something like @root/section to reference to the elements..
-----Original Message-----
From: Theo Galanakis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 8 June 2004 3:08 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: [OT] XPath in MS SQL

Hi Taco,

 

You could create a stored proc which accepts a XML string and parses it into a temp table.

 

Exec sp_xml_preparedocument @XmlHandle Output, @XMLparse

Insert Into @MyTable

Select CoverTypeID, ItemSQ, SituationID, ItemDescription, CoverAmount, CoverRate,CoverPremium, CoverAdd1, CoverAdd2, CoverAdd3

From  OpenXML ( @XmlHandle, '/cover/covertype/item',1 )

            With ( CoverTypeID int '../@id',

                      ItemSQ int '@id',

                              SituationID int '@situationID',

                        ItemDescription varchar(100) '@description',

                              CoverAmount money '@amount',

                              CoverRate money '@rate',

                              CoverPremium money '@premium',

                              CoverAdd1 real '@CoverAdd1',

                              CoverAdd2 real '@CoverAdd2',

                              CoverAdd3 real '@CoverAdd3' )

 

 

 

 

 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Taco Fleur
Sent:
Tuesday, 8 June 2004 1:07 PM
To: CFAussie Mailing List
Subject: [cfaussie] [OT] XPath in MS SQL

 

I pass an XML document to MS SQL, I then parse it with sp_xml_preparedocument, I now have a handle to the document, is it possible to use XPath or something to do something like

SELECT * FROM tbl WHERE firstname = @search/firstname

I have been able to work with this xml document and insert it into the db as
INSERT INTO
SELECT *
FROM OPENXML(......

Which works like a dream, but what about some fancier stuff like the above?????

Anyone, since you are all so anxious to make some noise?...


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
Register now for the 3rd National Conference on Tourism Futures, being held in Townsville, North Queensland 4-7 August - www.tq.com.au/tfconf

This message may contain privileged or confidential information and is intended only for the individual named. If you are not the named addressee you should not disclose, disseminate, distribute or copy this e-mail. If you have received this e-mail by mistake please notify the sender immediately by e-mail and delete this e-mail from your system. You should rely on your own virus checking programmes and procedures for checking any attachments. Please advise us if you wish your name and e-mail address to be removed from our database.


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
Register now for the 3rd National Conference on Tourism Futures, being held in Townsville, North Queensland 4-7 August - www.tq.com.au/tfconf

Reply via email to