Database Design
Hi All,
I need some advice and reference on database design.
The database my application uses will have many tables, each with many columns. Most of the columns store data generated automatically by the application, and the data could be regenerated and overwritten by the app when necessary. However, I want to have the ability to let user overwrite the values through UI, so the app would not overwrite them.
This is similar to the Tax software, where you can overwrite almost anything.
What is the best design for this?
Thanks in advance.
Regards,
Q
[615 byte] By [
Qdshi] at [2007-12-25]
Check out the very robust SQL project examples as found in the
Starter Kits to see if they can give you insight on your particular problem. Each DB design is different and you are more familiar with what is needed that us. Good luck.
One way to do that is not to store the generatable fields and generate them when needed (e.g. for display). Only store something in the fields if a user save something
Then way when you generating the content, if there is value in the field you do not generate it (i.e. you don't override the user)
Arnon
This is more of an application design than the database design. You define your database, whatever way you want - many tables and each table with many columns. You can have some event based auto generation of the data and also user invoked event. In case of the user invoked event, you present the existing data (or auto generated data) to the user so that he can make alterations to it and save the data.
I think you can solve it simple.
You shoud add a string field. In this field you put a binary string, with one bit for each field.
If a field is updated by the user, just update the bit
Regards
RI
This is very interesting. a very good idea. it should work.
I had thought to use the following means:
For those columns in whatever table that could be potentially overwritten. there is a Guid column in the table. and then in a tracking table, store the overwritten field's row GUID, Column Name, or maybe some note, so the calculation routine can check the table for any field in any table to see if it was a overwritten value.
Now I am wondering which way is better in terms performance and mainteneince. and in addition, could you easily update binary into database?
Thanks.
Q