SQL Server Performance

How to Join XML

Discussion in 'Non-Transact SQL Developer Performance Tuning' started by sramesh, Aug 7, 2006.

  1. sramesh New Member

    Hi, all
    I have 4 stored procedure. 4 procedures are return xml format.
    how to join 4 procedure.
    eg.
    procedure 1:
    <Root>
    <Company data="1">
    <Company data="2">
    </Root>
    procedure 2:
    <Root>
    <Customer data="1">
    <Customer data="2">
    </Root>

    procedure 3:
    <Root>
    <Emp data="1">
    <Emp data="2">
    </Root>

    procedure 4:
    <Root>
    <Sal data="1">
    <Sal data="2">
    </Root>


    i want join this 4 procedure and produce like this
    <Root>
    <Company>
    <Root>
    <Company data="1">
    <Company data="2">
    </Root>
    </company>
    <customer>
    <Root>
    <Customer data="1">
    <Customer data="2">
    </Root>
    </customer>
    <Emp>
    <Root>
    <Emp data="1">
    <Emp data="2">
    </Root>
    </Emp>
    <Sal>
    <Root>
    <Sal data="1">
    <Sal data="2">
    </Root>
    </Sal>
    </Root>

    How it is possible?





    Thanks
    S. Ramesh
  2. sramesh New Member

    Hi
    i got the ans
    select '<Root>'
    select '<Company>'
    exec procedure1
    select '</company>'
    select'<customer>'
    exec procedure2

    select '</customer>'
    select '<Emp>'
    exec procedure3
    select '</Emp>'
    select '<Sal>'
    exec procedure4
    select '</Sal>'
    select '</Root>'


    Thanks
    S. Ramesh

Share This Page