Click here to Skip to main content
11,484,402 members (66,050 online)
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 20: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 Maciej Los 190
1 Sergey Alexandrovich Kryukov 170
2 Raje_ 155
3 OriginalGriff 147
4 Mehdi Gholam 120
0 Sergey Alexandrovich Kryukov 8,484
1 OriginalGriff 7,948
2 Sascha Lefèvre 3,199
3 Maciej Los 2,681
4 Richard Deeming 2,370


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 3 Mar 2013
Copyright © CodeProject, 1999-2015
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