Showing posts with label nodes. Show all posts
Showing posts with label nodes. Show all posts

Friday, March 23, 2012

loop through xml nodes in sql

Hi,

I would like to loop through myXml nodes and modify them in sql.

i have got something like this:

<Root>

<ValueHolder>

<Value>3.00</Value>

<IsNoteDirty>false</IsNoteDirty>

<Timestamp>

<StampType>Month</StampType>

<Stamp>3</Stamp>

<Year>2007</Year>

</Timestamp>

</ValueHolder>

<ValueHolder>

<Value xsi:nil="true" />

<IsNoteDirty>false</IsNoteDirty>

<Timestamp>

<StampType>Month</StampType>

<Stamp>4</Stamp>

<Year>2007</Year>

</Timestamp>

</ValueHolder>

<ValueHolder>

<Value>2.00</Value>

<IsNoteDirty>false</IsNoteDirty>

<Timestamp>

<StampType>Month</StampType>

<Stamp>5</Stamp>

<Year>2007</Year>

</Timestamp>

</ValueHolder>

<ValueHolder>

<Value>5.00</Value>

<IsNoteDirty>false</IsNoteDirty>

<Timestamp>

<StampType>Month</StampType>

<Stamp>6</Stamp>

<Year>2007</Year>

</Timestamp>

</ValueHolder>

</Root>

And i want to loop over all the "Value" nodes and modify their value.

How can I do it?

This should get you started. The following query will list out the value. From there, it will depend on what you want updated before we update it. Hope this helps.
Tim

declare @.xml xml
set @.xml = '
<Root>
<ValueHolder>
<Value>3.00</Value>
<IsNoteDirty>false</IsNoteDirty>
<Timestamp>
<StampType>Month</StampType>
<Stamp>3</Stamp>
<Year>2007</Year>
</Timestamp>
</ValueHolder>
<ValueHolder>
<Value>23.00</Value>
<IsNoteDirty>false</IsNoteDirty>
<Timestamp>
<StampType>Month</StampType>
<Stamp>3</Stamp>
<Year>2007</Year>
</Timestamp>
</ValueHolder>
</Root>'

select Tab.Col.value('(Value)[1]','MONEY')
from
@.xml.nodes('/Root/ValueHolder') Tab(Col)

Wednesday, March 7, 2012

Looking for step by step guide/white paper to install MS SQL Clust

Hello,
I need to install a MS SQL 2000 Cluster server which will include 2 nodes
(setup as standard).
Where can I find a step by step documentation about that and
hardware/software requirements?
Thanks,
Don DiegoHi
There is quite alot of information in books online:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_clustering_2icn.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_clustering_2icn.asp
Not a step by step guide but check out the following and links in Appendix B
http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/32bitconsolidation.mspx
John
"dondiego" wrote:
> Hello,
> I need to install a MS SQL 2000 Cluster server which will include 2 nodes
> (setup as standard).
> Where can I find a step by step documentation about that and
> hardware/software requirements?
> Thanks,
> Don Diego|||Thanks John - I'll have a look at the links.
"John Bell" wrote:
> Hi
> There is quite alot of information in books online:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_clustering_2icn.asp
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_clustering_2icn.asp
> Not a step by step guide but check out the following and links in Appendix B
> http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/32bitconsolidation.mspx
> John
> "dondiego" wrote:
> > Hello,
> >
> > I need to install a MS SQL 2000 Cluster server which will include 2 nodes
> > (setup as standard).
> > Where can I find a step by step documentation about that and
> > hardware/software requirements?
> > Thanks,
> > Don Diego|||Hi
You may also want to look at
http://www.microsoft.com/windows2000/techinfo/planning/server/clustersteps.asp
John
"dondiego" wrote:
> Thanks John - I'll have a look at the links.
> "John Bell" wrote:
> > Hi
> >
> > There is quite alot of information in books online:
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_clustering_2icn.asp
> >
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_clustering_2icn.asp
> >
> > Not a step by step guide but check out the following and links in Appendix B
> > http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/32bitconsolidation.mspx
> >
> > John
> >
> > "dondiego" wrote:
> >
> > > Hello,
> > >
> > > I need to install a MS SQL 2000 Cluster server which will include 2 nodes
> > > (setup as standard).
> > > Where can I find a step by step documentation about that and
> > > hardware/software requirements?
> > > Thanks,
> > > Don Diego|||Hi
Other things to look at!
http://support.microsoft.com/default.aspx?scid=kb;en-us;259267&sd=tech
John
"John Bell" wrote:
> Hi
> You may also want to look at
> http://www.microsoft.com/windows2000/techinfo/planning/server/clustersteps.asp
> John
> "dondiego" wrote:
> > Thanks John - I'll have a look at the links.
> >
> > "John Bell" wrote:
> >
> > > Hi
> > >
> > > There is quite alot of information in books online:
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_clustering_2icn.asp
> > >
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_clustering_2icn.asp
> > >
> > > Not a step by step guide but check out the following and links in Appendix B
> > > http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/32bitconsolidation.mspx
> > >
> > > John
> > >
> > > "dondiego" wrote:
> > >
> > > > Hello,
> > > >
> > > > I need to install a MS SQL 2000 Cluster server which will include 2 nodes
> > > > (setup as standard).
> > > > Where can I find a step by step documentation about that and
> > > > hardware/software requirements?
> > > > Thanks,
> > > > Don Diego