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?