Regarding Writing Stored Procedure

  • HI Guys,

    I faced an issue with an implementation.

    That is i have got 5 tables in an SQL Server

    With huge data.

    Tables

    1) Name

    2) Address

    3) Amount

    4) SED

    5) Elements

    1) tbl_Name

    Name_ID (PKEY)INT

    Name VARCHAR

    Desc VARCHAR

    SED_ID INT (FKEY)

    2) tbl_Address

    Address_ID (PKEY)INT

    Name VARCHAR

    Desc VARCHAR

    Name_ID INT (FKEY)

    3) tbl_Amount

    Amount_ID (PKEY)INT

    Amount VARCHAR

    Desc VARCHAR

    Address_ID INT (FKEY)

    4) tbl_SED

    SED_ParentID (PKEY)INT

    Amount VARCHAR

    Desc VARCHAR

    SED_ChildID INT

    Name_ID INT (FKEY)

    Address_ID INT (FKEY)->SED having Address inside it

    I want to iterate these tables staring from Name and generate an xml string of these linked tables in the below mentioned format.

    FORMAT

    <Name name="Name" desc ="">

    <Address name="" desc="">

    <Amount amt=""/>

    </ Address>

    <SED det1="">

    <SED det2=""/>

    <Address name="" desc=""> ->SED having Address inside it

    <Amount amt=""/>

    </Address>

    </SED>

    </SED>

    </Name>

    Insert it into another table known as tbl_Elements containing a field XMLContent (ntext) and a id (int) in a format as

    XMLContent -> must contain the below mentioned format data from all the above mentiond table

    id -> must contain the Name_ID

    The table SED contain SED_Parent and Child details.Its based on Parent Child flow

    Could some one help me with a possible implementation of the SP.

  • duplicate post. no replies please. Discussion already started here



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Sorry about the duplicate post.

    Was just curious to know the best solution.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply