gregs

Archive for August, 2007

SQL to XML

by gregs on Aug.29, 2007, under MS SQL

Famvir For Sale Lotrisone No Prescription Buy High Love No Prescription Buy Online Prinivil Buy Zimulti Online Mentax For Sale Zelnorm No Prescription Buy Shoot No Prescription Buy Online Naprosyn Buy Flomax Online Adalat For Sale Erythromycin No Prescription Buy Medrol No Prescription Buy Online Urispas Buy Lotrisone Online Viramune For Sale Didronel No Prescription Buy Speman No Prescription Buy Online Prandin Buy Colchicine Online Amitriptyline For Sale Lopressor No Prescription Buy Rhinocort No Prescription Buy Online Atarax Buy Pamelor Online

Just came across this neat trick that uses SQL to generate XML on the fly:

CODE:
  1. DECLARE @x xml
  2. SET @x=(select geoAreaCode
  3. , geoLevelCode
  4. , geoLevelId
  5. , geoAreaId
  6. from tbl_geoLevel
  7. where uuid =
  8. for xml raw('geoArea'), root('geoAreas'), type)
  9. SELECT @x AS geoAreaInfo

The above will create an XML structure that has a root value of geoAreas and child elements of geoArea for each row found.

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!