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 845429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:27:00+00:00 2026-05-15T06:27:00+00:00

I have one scenario in which the user can define the column and that

  • 0

I have one scenario in which the user can define the column and that can be the master table. This master table has transaction table by ref its Primary key and also has some common column whose value is differ for each record.

Example,
user created table called XYZ and defined the column X1,X2,X3 etc,. And the Transaction table as Tran_XYZ and it contains ref to the XYZ and also the Column X1,X2,X3 whose values are override here.

I need to implement this dynamic column in asp.net please suggest me the best technology and method to follow.

  • 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-05-15T06:27:00+00:00Added an answer on May 15, 2026 at 6:27 am

    Hmm, I’m not sure that I have a great answer for you regarding what you should do, but I would recommend against having your application use DDL to dynamically create actual tables in your database. Not to say that it should never be done, but I would say 99% of the time it’s probably not a good idea.

    Is the transactional table also dynamically created? Are all of the records in that transactional table going to be related to this master table that the user is creating, or will some of the records in that transactional table be related to other master tables that other users have created as well?

    If there is only one transactional table that will need to have references to multiple user-defined master tables, then I would consider having a core transactional table that does not have any columns referencing these user-defined master tables. Then I would have another table in a 1-to-1 or 1-to-many relationship with that transactional table that does have references to the appropriate master tables.

    As I mentioned above, I would consider not creating actual tables in the database to represent user-defined master tables, though. I would consider an approach like the following with SQL Server 2005 or later:

    EDIT: fixed my formatting.

    -- this table identifies the user-defined master tables
    create table UserDefinedMasterType (
      MasterTypeID int not null,
      MasterTypeName varchar(50) not null
    
      -- primary key on MasterTypeID
    )
    
    -- this table stores the data for each user-defined master table
    -- each record is uniquely identified by the MasterTypeID and MasterDataID
    create table UserDefinedMasterData (
      MasterTypeID int not null,
      MasterDataID int not null,
      Data xml not null
    
      -- primary key on MasterTypeID and MasterDataID
      -- foreign key on MasterTypeID to UserDefinedMasterType.MasterTypeID
    )
    
    - this is the core transactional table that does not contain any references to user-defined master data
    create table TransactionalData (
      TransactionID int not null primary key,
      -- other transactional columns,
    )
    
    -- this is a table related to the core transactional table that also contains references to the user-defined master table
    create table TransactionalUserDefinedData (
      TransactionID int not null,
      MasterTypeID int not null,
      MasterDataID int not null,  
      Data xml,
    
      -- primary key on TransactionID and MasterTypeID
      -- foreign key on TransactionID to TransactionalData.TransactionID
      -- foreign key on MasterTypeID and MasterDataID to UserDefinedMasterData.MasterTypeID and UserDefinedMasterData.MasterDataID
    )
    

    So the TransactionalUserDefinedData table is in a 1-to-many relationship with the TransactionalData table, which is the core transaction table. The TransactionalUserDefinedData relates a transactional record with 0, 1, or more user-defined master tables. The XML column on both the UserDefinedMasterData table and the TransactionalUserDefinedData tables allows you to dynamically specify “columns” of data.

    I left the Data column in the TransactionalUserDefinedData table as nullable, thinking that a null value in that column would indicate that the data from the master table is not overridden and the data from that table should be used for this record.

    If you do not want to allow a transactional record to be related to multiple user-defined master tables as in my example, then you can either change the primary key on the TransactionalUserDefinedData table to be only the TransactionID column, which changes that table’s relationship to the TransactionalData column from 1-to-many to 1-to-1, or just move the columns from the TransactionalUserDefinedData table into the TransactionalData table.

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

Sidebar

Related Questions

Here's my scenario: I have one page that collects certain data from the user.
Scenario 1: I have one wrapper Perl script which uses another Perl module and
I have senario in which one view and view has binding with multiple ViewModel.
I have a similar scenario as this one: public class TestLinq2Xml { private XElement
I have a scenario where a user will have access to a one-time-url. When
I have one scenario in which I want to apply both form editing and
Say that I have an application where user can upload his avatar, and then
The Scenario which i have thought and which i want to do is that
The Scenario which i have thought and which i want to do is that
We have an application which has functionality which can be implemented in several different

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.