Tuesday, February 21, 2012
rotates between Active and Passive node
Do anyone rotate the active and passive nodes in your cluster? From hardware
wear and tear point of view, it sounds reasonable.
Please share your thoughts.
Thanks!
Hi
I would not be worried about wear and tear...the hard drives are the ones
getting it, and they are shared.
From a confidence point of view, yes. You know the failover works and that
there are no problems with the node.
Regards
Mike
"Raymond Fang" wrote:
> Hi, all.
> Do anyone rotate the active and passive nodes in your cluster? From hardware
> wear and tear point of view, it sounds reasonable.
> Please share your thoughts.
> Thanks!
>
>
Root node from a FOR XML
How can I get a XML with a root node from a FOR XML ?:
Now I have this:
The SQL:
SELECT * FROM Table_Projects Projectand the XML output:
FOR XML AUTO
<Project>and I want this:
<ItemID>1</ItemID>
....
</Project>
<Project>
<ItemID>2</ItemID>
....
</Project>
...
<Projects>thanks and regards,
<Project>
<ItemID>1</ItemID>
....
</Project>
<Project>
<ItemID>2</ItemID>
....
</Project>
...
</Projects>
Edu
What client are you using, just TSQL or ADO or ADO.net, etc|||Hello pkr,
I'm using ADO.NET on an ASP.NET page (with c#)
Now I am using the following code to solve the problem:
XmlDocument xmlDoc =new XmlDocument();
myConnection.Open();
SqlDataReader dr = myCommand.ExecuteReader();
string stringXml = "<Projects>";
while (dr.Read())
{
stringXml += dr.GetString(0);
}
stringXml += "</Projects>";
xmlDoc.LoadXml(stringXml);
myConnection.Close();
return(xmlDoc);
But I am searching for a solution on the SQL Server side ( without SQLXML 3.0 for the moment)
Regards,
Edu
|||Ah yes the holy grail of avoiding SQLXML, sorry I don't believe there is such a beast, at least not yet. One, and I think horrible, way it to use mutliple results sets...
<code>
Select '<root>'
Select * from table for xml raw
Select '</root>'
</code>
Horrible isn't? I think the way you're currently doing is the best of a bad bunch.|||I've done this with the use of FOR XML EXPLICIT and a UNION ALL. Here are 3 resources on this topic that I've personally found to behelpful:
SQL Server 2000, XML and XSL: The Ultimate Combination
Retrieving XML from SQL Server Using SELECT ... FOR XML
Demystify SQL Server FOR XML EXPLICIT
|||Yes good point, although IMHO xml explicit is a horrible syntax, luckily they've done a much better job in 2005.
Root node attributes
Hello,
I've been trying to craft some xml that has attributes on the root, but without any success.
For example :-
SELECT
Test1 "Test1",
Test2 "Test2"
FROM
TestTable
FOR
XML PATH('TestValue'),
ELEMENTS,
ROOT('TestValues test=1') <-- this is not allowed, but this is the kind of thing that i would like
To produce :-
<TestValues test=1>
<TestValue>
<Test1>asdf </Test1>
<Test2>asdf </Test2>
</TestValue>
<TestValue>
<Test1>asdf </Test1>
<Test2>asdf </Test2>
</TestValue>
</TestValues>
Any ideas?
Thanks
Cedric
Don't you hate it when you click on the send button and at the same time an idea pop's into your head?!
Just thought i'd answer my own question incase someone is interested...
SELECT 1 '@.Test',
(
SELECT
Test1 "Test1",
Test2 "Test2"
FROM
TestTable
FOR
XML PATH('TestValue'),
TYPE
)
FOR
XML PATH ('TestValues')
Clearly there was too much blood in my coffee stream...
Thanks
Cedric