Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: XML SQL-Server
Dear Friends,
 
I have create a page display few details.
But the query takes more time to execute the page.
So I have planed to convert the query data to XML format and store it in a table.
Then converting the XML data to display in page.
 
By executing the this line i can get the XML data but how to store the same in different table.
Select DT=Getdate() into #TEMP
SELECT * from #TEMP FOR XML AUTO
SELECT * from #TEMP FOR XML RAW
 
Also kinldy explain me what is difference between XML AUTO and XML RAW
 
Kindly suggest or guide me on this.
Posted 8-Jan-13 19:39pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Quote:
The RAW mode generates a single element per row in the rowset that is returned by the SELECT statement. You can generate XML hierarchy by writing nested FOR XML queries.
 
The AUTO mode generates nesting in the resulting XML by using heuristics based on the way the SELECT statement is specified. You have minimal control over the shape of the XML generated. The nested FOR XML queries can be written to generate XML hierarchy beyond the XML shape that is generated by AUTO mode heuristics.

More at: http://msdn.microsoft.com/en-us/library/ms178107%28v=sql.105%29.aspx[^]
  Permalink  
Comments
RedDK at 4-Mar-13 12:49pm
   
Hey ML,
 
I saw a post yesterday, deep in the stack somewhere here in CPQA, that suggested there was a temp file of this .xml output. Is that notion true? And if it is, which temp might contain it? Sorry AN for hijacking your thread a little ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 6,725
1 OriginalGriff 6,696
2 CPallini 5,315
3 George Jonsson 3,589
4 Gihan Liyanage 2,650


Advertise | Privacy | Mobile
Web03 | 2.8.140921.1 | Last Updated 3 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100