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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:38:31+00:00 2026-06-16T03:38:31+00:00

As an alternative to anti-patterns like Entity-Attribute-Value or Key-Value Pair tables, is it possible

  • 0

As an alternative to anti-patterns like Entity-Attribute-Value or Key-Value Pair tables, is it possible to dynamically add columns to a data table via an INSERT trigger on a parameter table?

Here would be my tables:

CREATE TABLE [Parameters]
(
    id int NOT NULL 
        IDENTITY(1,1) 
        PRIMARY KEY,
    Parameter varchar(200) NOT NULL,
    Type varchar(200) NOT NULL
)
GO

CREATE TABLE [Data]
(
    id int NOT NULL
        IDENTITY(1,1)
        PRIMARY KEY,
    SerialNumber int NOT NULL
)
GO

And the trigger would then be placed on the parameter table, triggered by new parameters being added:

CREATE TRIGGER [TRG_Data_Insert]
    ON [Parameters]
    FOR INSERT 
AS BEGIN            
            -- The trigger takes the newly inserted parameter
            -- record and ADDs a column to the data table, using
            -- the parameter name as the column name, the data type
            -- as the column data type and makes the new column 
            -- nullable.
END
GO

This would allow my data mining application to get a list of parameters to mine and have a place to store that data once it mines it. It would also allow a user to add new parameters to mine dynamically, without having to mess with SQL.

Is this possible? And if so, how would you go about doing it?

  • 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-16T03:38:32+00:00Added an answer on June 16, 2026 at 3:38 am

    I think the idea of dynamically adding columns will be a ticking time bomb, just gradually creeping towards one of the SQL Server limits.

    You will also be putting the database design in the hands of your users, leaving you at the mercy of their naming conventions and crazy ideas.

    So while it is possible, is it better than an EAV table, which is at least obvious to the next developer to pick up your program؟

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

Sidebar

Related Questions

I'm being hit hard by the entity-attribute-value antipattern . Some day, years ago, a
I would like an alternative to using callback method inside of jQuery's .val() method
Is there another alternative (smaller) for to format a string separate with dots? Like
I've recently overheard people saying that data transfer objects (DTOs) are an anti-pattern .
Alternative titles How to download a web page data in Objective-C on iPhone? How
What is the alternative if I need to use a reference, and the data
Possible Duplicate: CURL alternative in Python I'm trying to write a python snippet that
Is there an alternative for selecting folders in C#? Optimally I'd like to use
Is there an alternative of using If to extract a value from a variable
is there any alternative bitmap class, where PixelFormat.Format16bppGrayScale , or something like this, is

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.