TechSapphire Thursday, 2024-04-18, 5:22 PM
Site menu
Login form
News
Play Games
  • Deep Freeze
  • Ice Slide
  • Gyroball
  • Fat Fish
  • Bush Royal Rampage
  • Main » 2014 » June » 10

    SQL XML:

    You can generate XML from SQL queries without even doing single line of code in your programming language. Below is the script used in above video:

    --Query 1

    select 1 as tag,null as parent,
    c.customerid as [Customers!1!Customerid],
    null as [order!2!orderid]
    from customers c inner join orders o
    on o.customerid=c.customerid
    union
    select 2 as tag,1 as parent,
    c.customerid,
    o.orderid
    from customers c inner join orders o
    on o.customerid=c.customerid
    order by [Customers!1!Customerid],[order!2!orderid]
    for xml auto

    --Query 2

    select 1 as tag,null as parent,
    c.customerid as [Customers!1!Customerid],
    null as [order!2!orderid]
    from customers c inner join orders o
    on o.customerid=c.customerid
    union
    select 2 as tag, ... Read more »

    Category: Database | Views: 9920 | Added by: Admin | Date: 2014-06-10 | Comments (0)

    Categories
    Programming [27]
    Tips for programming
    Security [2]
    Security Tips
    Google [1]
    Use google faster then ever you use
    Project [14]
    HTML [2]
    Electronics [0]
    Data Structure [0]
    Database [16]
    SQL SERVER
    SSRS [1]
    Sql Server Reporting Services
    Copyright MyCorp © 2024