Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select a row and return as XML?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01538717
Message ID:
01538722
Vues:
32
>>Hi,
>>
>>I need to write a stored procedure that will select a row from a table, then populate/create an XML string and return this XML string. (This stored procedure will be called from an ASP.NET application and the returned XML is parsed by C# code). My question (since I have not done it before), how do you create an XML in a stored procedure? And when you set values into this XML how to "point" to a value in the column? TIA and any suggestions or snippet of sample code.
>
>Hi Dmitry
>
>Have you tried the FOR XML clause in SQL?
>
>
>SELECT * FROM tablename FOR XML AUTO
>
>
>see...
>http://blah.winsmarts.com/2007-2-bak2basics__learn_t-sql_-_for_xml.aspx
>
>Kurt

No, I didn't try FOR XML because I didn't know of this syntax. Thank you, Kurt.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform