Table field change

Hi All,

I ahve a new requirement to change a filed which at a table level from int to real for which an EDT being used and I would like to change the EDT type to real.

When I looked at the cross reference tool it is being used at some more than 40 places ?what is the approach to make such database changes?



Discribe some detail about it means which field u want change type and which EDT it belongs.

The usual approach is to create a new field (with the new type) and rename the old one by adding the “DEL_” prefix (but keeping its ID the same). Code using the old field is non-compilable then, so you can easily verify whether you identified all places where it is used (OK, not everything is checked by compiler, but it’s not a problem in most cases).

After fixing your code, you need to write a data update script, in your case just moving data to the new field. (Notice that although the old field is renamed, it still has the same ID, therefore data are still there.) And when customer data are moved to the new field, the old one can be removed from database by disabling its configuration key (Microsoft uses SysDeletedObject* keys for this purpose).

If the field is not used in any live database, you can simply replace it by the field with the required type (and review the code). This changes field ID, of course.

Technically you can switch EDT’s very easily, the real problem is to synchronize the change with the database without any data loss.

Hi Martin,

Thanks for sharing me the approach.I have this approach in mind but I never changed field datatypes ever could you share me the links or docuementation which details out the approach.



Sorry, I don’t know any documentation (though some information can be found on MSDN, e.g. Data upgrade: how it works).

Which part is unclear to you?