October 7, 2009 at 5:45 am
SELECT id as 'data()',
customer as 'data()'
FROM #customers AS customesra
ORDER BY customer DESC
FOR XML PATH(''),ROOT('customers')
I cannot view the full XML string.
October 7, 2009 at 7:31 am
I'm getting the same result for all the 4 queries posted.
anybody else?
Lucky
October 7, 2009 at 7:44 am
"None of them" was not a choice so I picked all of them since they all return the same result.
October 7, 2009 at 7:50 am
To setiv:
If you want everything you need to set the "Results To Text" option. It's under Tools/Options/Query Results/SQL Server or better yet, if you have the right toolbar showing you can just click on the icon.
October 7, 2009 at 8:49 am
I am bad at XML, actually very bad. Have to execute each code in SSMS and then see the difference.
But still, what acually is different in C except that you see alias customersa and customersb, where as results are same and what is common between A, B and D queries ?
May be a person with good XML knowledge can explain.
SQL DBA.
October 7, 2009 at 8:50 am
lucky-80472 (10/7/2009)
I'm getting the same result for all the 4 queries posted.anybody else?
you see alias customersa and customersb in the resultset of C. where as in all other queries it's customers.
SQL DBA.
October 7, 2009 at 9:48 am
Sanjay is right.... it got me because I wasn't reading clearly.
<customersa customers.id="6">
Is not the same as
<customers customers.id="6">
🙂 Good question... shows me why I hate xml as much as I do 🙂
October 7, 2009 at 10:02 am
This will not help. I need to buy a new computer.
October 7, 2009 at 10:52 am
Setiv,
also open Tools -> Options -> Results to text and set the maximum length to a value higher than 256. I set mine to 4000 which works wonderfully 🙂
October 7, 2009 at 11:25 am
Setiv: You can also set Tools -> Options... -> Query Results -> Results to File and save the file as a text document (change the file type to All Files). However, I do recommend mtassin's suggestion over the Results to File option. Still, it's good to know all of your options so as to make a better decision.
--
KevinC.
October 7, 2009 at 12:31 pm
When querying A
(SQLServer2005, SQLServer2005_SSMSEE) displays:
"
<customers><customers id="6"><customers customer="Victoria"/>
</customers><customers id="2"><customers customer="Lyss"/>
</customers><customers id="1"><customers customer="John"/>
</customers><customers id="3"><customers customer="Jack"/>
</customers><customer
"
This may be the result of installation of incomplete version
(SQLServer2005, SQLServer2005_SSMSEE)
What Kit you can recommend?
October 9, 2009 at 1:08 am
The third query gives other result than first tree - look at the element names
Kindest Regards,
Damian Widera
SQL Server MVP,
MCT, MCSE Data Platform, MCSD.NET
October 13, 2009 at 1:54 am
Quiz doesn't work at all booooh!!
October 29, 2009 at 1:34 am
Me too get same result for all 4 options
Viewing 15 posts - 1 through 15 (of 15 total)
You must be logged in to reply to this topic. Login to reply