Create a script to remove a column present on all the enities.

Trying to write a script to remove a column on all the tables in the model (> 800). Looking at the examples I can access the entity and attributes in a for loop.


Attribute = Entity.Attributes.GetObject(a);
//Attribute.Lock();
//Attribute.Name = Attribute.Name.toLowerCase(); //change name of attribute
//Attribute.UnLock();
if ((Attribute.Name.indexOf(“CREATED_”) > -1) )
??? delete the attribute

How do I delete the attribute??

Entity.Lock();

Attribute = Entity.Attributes.GetObject(a);

if ((Attribute.Name.indexOf(“CREATED_”) > -1) )

Attribute.Delete();

Entity.UnLock();

In case of any questions, please write us back. Thanks.

Regards,

Vladka + Mario

Hi,

Sorry for the delay. Here’s a part of a script that should help you:
del_attrib.txt (178 Bytes)