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

  • Home
  • SEARCH
  • 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 6194699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:20:24+00:00 2026-05-24T03:20:24+00:00

I am using SQL SERVER 2005. I have a table table1(ID,col1,col2,col3,col4); Now I have

  • 0

I am using SQL SERVER 2005.

I have a table

table1(ID,col1,col2,col3,col4);

Now I have a business logic like:

If col1 >= 126 and col2 > 1 then col3 = 0
if col1 >=126 and col2 < 1 then col3 = col1+col4

Now what I am trying to do is store all these rules in database and make it data driven. THe reason for that is to give the end user more flexibility. If tomorrow the business rules changes, end user have the flexibility to change it through the GUI. For eg. if tomorrow the business wants to change the comparision value from 126 to 200 they should be able to change that through the interface. As far as possible I am trying to give flexibility like ability to change columns too like business should able to change the rule so instead of col1 they can change new rules to col2. and if possible they can also have the ability to change the operators too instead of >= they can change it to <=.

I want to change it more data driven so when the value is changes in the table we don’t need to change the code.

Is it possible to do this thing in database? Can someone suggest the data model that supports this business rules to be data driven?

  • 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-24T03:20:25+00:00Added an answer on May 24, 2026 at 3:20 am

    Do not store code in the database. The database is for data. Code is for code.

    See the Inner-Platform Effect antipattern.

    Maaaybe you could store values like your 126 and 200 in the database, but I’d put them in a config file. But once the users want so much flexibility that you have to design a data-driven business rules engine for them, you’re totally reinventing the wheel.

    It’ll be a nightmare for you in the following ways:

    • Security risks, because user-specified expressions creates an opening for code injection attacks.
    • Testability, because you can’t predict the ranges of operations if your rules engine includes a constructive grammar.
    • Performance, because users will add tons of arbitrary expressions and sorting criteria that won’t go through performance testing and optimization before running on your server.
    • Maintenance, because users will become accustomed to the idea that they can do anything, but they can imagine reports far more complex than you can code your business rules to handle.

    Update: there are business rules platforms such as Drools, but these should have their own language for executing business rules. SQL is not the best language to do that.

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

Sidebar

Related Questions

I am using SQL server 2005. I have a table like this - ID
I am using SQL Server 2005. I have a table called Product. Now I
[using SQL Server 2005] I have a table full of users, I want to
I am using SQL Server 2005. I have a table with a text column
I'm using SQL Server 2005 express I have a datetime field in a table
Using SQL Server 2005 I have a table with the following columns id name
I am using sql server 2005 I have a table [say tblHistory] and this
I'm using Sql-Server 2005 I have Users table with userID and gender. I want
I'm using SQL-Server 2005. I have table with many columns, rows i select have
I'm using SQL Server 2005. I have a table whose row size should be

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.