hierarchical linking of locations to each other

  • I need help here, I have this table, I may need to create another column I'm not sure yet.

    CREATE TABLE [dbo].[Location](

    [LocationID] [int] IDENTITY(1,1) NOT NULL,

    [Location] [nvarchar](255) NOT NULL,

    [Product_Code] [nvarchar](255) NOT NULL,

    [LocationProductStockAmt] [decimal](18, 2) NULL)

    And I need to create a database object that can store hierarchical linking of locations to each other. Ensure referential integrity is enforced.

    One location cannot be linked to more than one parent location.

    For example if I have location South Africa and I want to link Gauteng and to Gauteng I want to link Johannesburg. South Africa => Gauteng => Johannesburg

  • hoseam (11/1/2013)


    I need help here, I have this table, I may need to create another column I'm not sure yet.

    CREATE TABLE [dbo].[Location](

    [LocationID] [int] IDENTITY(1,1) NOT NULL,

    [Location] [nvarchar](255) NOT NULL,

    [Product_Code] [nvarchar](255) NOT NULL,

    [LocationProductStockAmt] [decimal](18, 2) NULL)

    And I need to create a database object that can store hierarchical linking of locations to each other. Ensure referential integrity is enforced.

    One location cannot be linked to more than one parent location.

    For example if I have location South Africa and I want to link Gauteng and to Gauteng I want to link Johannesburg. South Africa => Gauteng => Johannesburg

    Duplicate post. http://www.sqlservercentral.com/Forums/Topic1511001-391-1.aspx

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

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