July 28, 2008 at 8:21 am
with the xml below, how can i use a select statement to extract
the option name?
this is the first time im exposed to xml in a db so any help is appreciated.
thanks
July 28, 2008 at 9:20 am
anyone?
July 28, 2008 at 1:47 pm
Does this get you started in the right direction?
DECLARE @myvar AS XML
, @XMLDoc int
SELECT @myvar = '
<Movement xmlns="" Context="Acquire">
<OperationCollection>
<Operation Name = "Execute">
<OptionCollection>
<Option Name="Execution.Capability">(Synchronous,Asynchronous)</Option>
<Option Name="Execution.Preference">(Asynchronous)</Option>
<Option Name="Origin.Status.Criteria">(Fail)</Option>
</OptionCollection>
</Operation>
<Operation Name="ConnectorContext">
<OptionCollection>
<Option Name="Connector.MerchantIdentifier">56500</Option>
<Option Name="Connector.Alias">CC_01</Option>
<Option Name="Connector.Wallet.TransactionIdentifier">(wirecard:Transaction)(00000000000000000000000001xP2)()</Option>
<Option Name="Connector.TrasactionIdentifier">(wirecard:Transaction)C242720181323966504820)()</Option>
<Option Name="Connector.Context">wirecard</Option>
</OptionCollection>
</Operation>
</OperationCollection>
</Movement>
'
EXEC sp_xml_preparedocument @XMLDoc OUTPUT, @myvar
SELECT *
FROM OPENXML(@XMLDoc, '/Movement/OperationCollection/Operation/OptionCollection/Option', 1)
WITH (NAME varchar(100) '@Name')
Hope this helps!
Chad
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply