MarkK
bit cruncher
- Local time
- Today, 14:18
- Joined
- Mar 17, 2004
- Messages
- 8,181
I'll repeat, if your DB is properly designed you should not need to add columns, much less add them programmatically. A field named "ReferencePoint" in a table called "RootCanal" sounds important, and it is therefore, IMO, a design failure to need to add it using code. It should be there from design time on.
That, or you have confused your data with your structure, for instance it is obvious that if you have a system keeping track of people you don't have tables called Sue, Phil, Ed, Bob, Katrina, and so on. No. You have a table called People, and that table has a single field called FirstName.
But RootCanal is the name of a treatment the same way that John is the name of a person. To have a table called RootCanal is probably a mistake that then requires you to make other mistakes, like what happens now if you add a ScalingTreatment table. Now, how do you list the treatments you offer? You should have a Treatments table in which RootCanal should be a row.
I repeat, if you need to programmatically add columns as a part of the routine maintenance of your data, you have made a mistake.
That, or you have confused your data with your structure, for instance it is obvious that if you have a system keeping track of people you don't have tables called Sue, Phil, Ed, Bob, Katrina, and so on. No. You have a table called People, and that table has a single field called FirstName.
But RootCanal is the name of a treatment the same way that John is the name of a person. To have a table called RootCanal is probably a mistake that then requires you to make other mistakes, like what happens now if you add a ScalingTreatment table. Now, how do you list the treatments you offer? You should have a Treatments table in which RootCanal should be a row.
I repeat, if you need to programmatically add columns as a part of the routine maintenance of your data, you have made a mistake.