Results 1 to 2 of 2

Thread: SP needed

  1. #1
    Join Date
    Feb 2004
    Location
    india
    Posts
    67

    Unanswered: SP needed

    Dear Gurus,

    I need to deploy this func. to prod.
    Please help me

    I have a table

    Table 1

    SiteID ParentSiteID default_siteid Root_siteID
    229 294 294 294
    228 294 294 294
    227 296 296 296
    227 293 NULL 293
    293 NULL NULL NULL
    294 NULL NULL NULL
    295 NULL NULL NULL
    296 NULL NULL NULL
    297 NULL NULL NULL
    229 227 NULL 293
    228 293 NULL 293

    I need a SP
    With one parameter (SiteID)
    Values would be any of the Site IDs with ParentSiteID, default_siteid, Root_siteID
    With nulls (293,294,295,296,297)

    Expected output is all the attached IDs attached to the ID

    IP :293
    OP:
    293
    293\227
    293\227\229
    293\228

    Theoritically there is no end to hierarchy
    Thanks in advance
    srinivas

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Have a look in Books Online about recursive CTEs. There should be examples there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •