Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Help with OPENXML

Author  Topic 

DBASlut
Yak Posting Veteran

71 Posts

Posted - 2008-05-30 : 19:01:19
I need to take this XML:
<?xml version="1.0" ?>
- <records>
- <record>
<f id="25">AAH01</f>
<f id="36">cwaah_07001</f>
<f id="202">41</f>
<f id="45">IMPLEMENTATION</f>
<f id="15" />
<f id="159">Cancelled</f>
<f id="47" />
<f id="210">Client</f>
<f id="21">ADD AAH PA LETTERS (MEDRESPONSE)</f>
<f id="215">41</f>
<f id="3">7514</f>
<f id="114">1</f>
<f id="287">1179705600000</f>
</record>
- <record>
<f id="25">SAC01</f>
<f id="36">cwsac_07007</f>
<f id="202">122.75</f>
<f id="45">IMPLEMENTATION</f>
<f id="15">1203897600000</f>
<f id="159">Completed</f>
<f id="47" />
<f id="210">GIGAbase</f>
<f id="21">SAC COMMERCIAL PA LETTERS</f>
<f id="215">122.75</f>
<f id="3">7513</f>
<f id="114">0</f>
<f id="287">1179705600000</f>
</record>

and for each 'record' node, create a row in a table. ie.
<f id="21">SAC COMMERCIAL PA LETTERS</f> would go into comments as 'SAC COMMERCIAL PA LETTERS'
<f id="287">1179705600000</f> would go into account_number as 1179705600000
How would my SQL look? I don't know what to put for the question marks..
SELECT *
FROM OPENXML (@idoc, '????' )
WITH (Comments varchar(255) '???',
account_number varchar(255) '???')

   

- Advertisement -