Hi,
I'm interested in understanding if there is a common technique/pattern for checking data in a database conforms to a set of rules. I'm interested, perhaps, in running a service/job each night that churns through the data and raises exceptions to rules. I would quite like the system to be dynamic, i.e. it's quite easy to define new rules.
A very simple example could be:
Customer Cash%
A 50
B 25
C 30
Rule: Tell me all customers that have < 50% cash.
I'm not really coupled to a particular tool or idea, however our expertise are C#, XML and Sql Server. All our data is in SQL SERVER Databases.
If there isn't anything I will go back to looking at a custom rule defining system, currently my idea is based around rules defined in XML (for the dynamic aspect) and a Windows Service process data against the rules.
Cheers.
EDIT: I should say that this could get complex, whereby I would like to check a bunch of tables and their data against a "Model" to see whether a particular object is following rules. For example there might be a "Model" customer and you want to check how many customers don't follow the model rules, e.g. Cash, Last Payment, Nationality etc.
EDIT: Following on from a couple of comments, I fully understand that "invalid" data should be prevented from been entered in the first place. My scenario deals with the fact that the data may be perfectly valid, however it might not follow "house rules", things that don't follow the rules might then need to be justified.