1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Rep Power

    How to make this a Hierarchy syntax?

    I'm trying to make that I have in my What'up. A hierarchical syntax

    I have the following;
    I have the following tables that I use for making a hierarschische group syntax; ndevicegroupID, nparentgroupID and Sgroupname. These can be found in Device Group.

    Main has the following ID
    ndevicegroupID nParentGroupID sgroupname
    192 0 Environment

    The next customer RB has a nparentgroupID and ndevicegroupID;

    ndevicegroupID nparentgroupID sgroupname
    45 192 RB

    And the customer also has locations;
    sgroupname nparentgroupid ndevicegroupid
    APL 45 565

    and the location has sub locations;
    sgroupname nparentgroupID ndevicegroupID
    Ser1a 565 566

    I hope I can give to clarify enough information.

    Hope that this SQL syntax to make it right.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Rep Power
    there good auricle for your problem http://blog.sqlauthority.com/2012/04/24/sql-server-introduction-to-hierarchical-query-using-a-recursive-cte-a-primer/

IMN logo majestic logo threadwatch logo seochat tools logo