locked
show data in report with special order RRS feed

  • Question

  • User137014332 posted

    Hi all,

    i have a table(Sectors) with the structure

    Sec_Code    P.K

    Comp_Code

    sep_Sec_cd

    Sec_Name

    Sec_Level

     Sec_Parent    F.K(self join)

    i want to show the data in the report with the hierarchy

     

    Level1

         parent1

             level2(child of parent1)

             level2(child of parent1)

    Level1

         parent2

             level2(child of parent2)

             level2(child of parent2)

    Thanks

     

    Sunday, July 31, 2011 7:08 AM

All replies

  • User-1412735316 posted

    you can do it with recursive CTE. please follow the links

    http://www.4guysfromrolla.com/webtech/071906-1.shtml

    http://msdn.microsoft.com/en-us/library/ms186243.aspx

    Sunday, July 31, 2011 12:08 PM
  • User137014332 posted

    Thanks for your reply,

    But actually iam using SqlServer2000 and i didn't find recursive CTE on it.

    Tuesday, August 2, 2011 3:09 AM
  • User-1412735316 posted

    Then I think you won't be able to use CTE. how many levels are there in your structure?

    Tuesday, August 2, 2011 4:11 AM
  • User137014332 posted

    it is unlimited, it is dynamic

    Tuesday, August 2, 2011 6:46 AM