Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | a0f6459Starting Member
 
 
                                        4 Posts | 
                                            
                                            |  Posted - 2008-05-27 : 17:26:10 
 |  
                                            | Hi,I am pretty new to XML and webservices.  Basically I have a table that is loaded every few hours by a DTS package.  After each load, I want to create an XML to be sent through webservices.  How do I write a stored procedure to convert the contents of the table into XML?Any help would be greatly appreciated.ThanksAndrew |  |  
                                    | tkizerAlmighty SQL Goddess
 
 
                                    38200 Posts | 
                                        
                                          |  Posted - 2008-05-27 : 17:29:45 
 |  
                                          | You've posted in the 6.5/7.0 forum.  Are you really using one of these versions? If you are using at least version 2000, then you can use the FOR XML clause.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |  
                                          |  |  |  
                                    | a0f6459Starting Member
 
 
                                    4 Posts | 
                                        
                                          |  Posted - 2008-05-27 : 17:31:44 
 |  
                                          | I've been told by our admin that it is SQL 7.0Is that going to be a problem?Andrew |  
                                          |  |  |  
                                    | tkizerAlmighty SQL Goddess
 
 
                                    38200 Posts | 
                                        
                                          |  Posted - 2008-05-27 : 17:47:25 
 |  
                                          | Yes.  XML-support was not added until SQL Server 2000.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |  
                                          |  |  |  
                                    | a0f6459Starting Member
 
 
                                    4 Posts | 
                                        
                                          |  Posted - 2008-05-27 : 17:51:39 
 |  
                                          | I just googled the FOR XML clause  and tried it in the query analyzer with the table I want, it seems to work, so I'm not sure what version it is.How do I go from just a display in query analyzer to creating an XML file?ThanksAndrew |  
                                          |  |  |  
                                    | tkizerAlmighty SQL Goddess
 
 
                                    38200 Posts | 
                                        
                                          |  Posted - 2008-05-27 : 18:25:40 
 |  
                                          | Creating the XML file is outside of the scope of SQL Server.  You'd do that at the web service level via your programming language such as C#.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |  
                                          |  |  |  
                                |  |  |  |