Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8348263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:38:24+00:00 2026-06-09T07:38:24+00:00

First, this is not a question about how to implement inheritance in relational databases.

  • 0

First, this is not a question about how to implement inheritance in relational databases.

The Problem:

I have a system with several sub-systems that may have several others sub-systems and so on.
I need to create a database that will store configuration parameters for each system. Child systems will inherit settings from parents when their own settings where not provided. The inheritance is based in each parameter and not the full set of it.

Basically…

When Stored:

  • System A: background: white, stack-size: 100, threads: 50
    • System A-1: background: blue, stack-size: null, threads: null
      • System A-1-1: background: null, stack-size: 10, threads: null
    • System A-2: background: null, stack-size: null, threads: 150

When loaded:

  • System A: background: white, stack-size: 100, threads: 50
    • System A-1: background: blue, stack-size: 100, threads: 50
      • System A-1-1: background: blue, stack-size: 10, threads: 50
    • System A-2: background: white, stack-size: 100, threads: 150

How would you implement this, so it can also be loaded in a fast way?

I’m open for using either NoSql and Sql solutions. But my application to consume this will be written in C#.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:38:26+00:00Added an answer on June 9, 2026 at 7:38 am

    I have implemented something similar to this before (in MS Sql Server) using a self-referencing configuration table. Each entry would specify system, parent system, and setting name/value. This allows for flexibility around what settings are saved (rather than having a column for background, column for threads, etc). You can calculate the settings for a given system using a recursive CTE, as long as the number of levels doesn’t exceed the maximum recursion depth. As a place to start:

    CREATE TABLE Configuration (
        SystemId varchar(30), 
        ParentSystemId varchar(30), 
        Name varchar(30), 
        Value varchar(30)
    )
    

    And to retrieve the configuration for a system:

    ;WITH SystemConfig (Id, ParentId, Name, Value, Rank) AS (
        SELECT SystemId, ParentSystemId, Name, Value, 1
        FROM Configuration C
        WHERE SystemId = @SystemId
    
        UNION ALL
    
        SELECT D.SystemId, D.ParentSystemId, D.Name, D.Value, Rank + 1
        FROM Configuration D
        INNER JOIN SystemConfig S ON S.ParentId = D.SystemId
    )
    
    SELECT DISTINCT K.Name, V.Value 
    FROM SystemConfig K
    CROSS APPLY (
        SELECT TOP 1 Value
        FROM SystemConfig G
        WHERE K.Name = G.Name
        ORDER BY Rank
    ) V
    

    Demo SQL Fiddle

    I can’t say whether this is the most efficient way in SQL, and I’ve never attempted a NoSql solution, but this gets the job done and with reasonable indexing performs well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all: This question is not directly programming related. However, the problem only
this is my first question on stack overflow. Some quick background, this is not
this is my first question to SO so i'll try not to disgrace myself.
this is my first question here :) I know that I should not check
First of all I am not a designer. so this question is may be
First, let me state that this is a programming question (and thus does not
Excuse me first. because i don't know this is question is valid or not.
This was originally going to be a question about how to implement this because
First, my question is not about password hashing, but password encryption. I'm building a
First, I know this question has been asked several times before and that in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.