cancel
Showing results for 
Search instead for 
Did you mean: 

Replication Properties of Tables of Columns

0 Kudos

Hi,

I replicated 1000 tables to another model. Put the replicated tables into the package.


Now I unchecked on column level the Replication Properties - datatype so the changed data type will not be propaged anymore to the replication model if the data type was changed on the source column.

It is working. The problem is that I need to do it one by one which is thousands of columns. Do you know how I can make this change for all columns at the one time?

Thank you,

Michal Skoda

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member200945
Contributor
0 Kudos
Run the following code 

set packages=ActiveModel.packages
for each pack in packages
   
  for each tab in pack.tables  
       for each col in tab.columns
          col.SourceReplication.delete
       next
  next
next
 
GeorgeMcGeachie
Active Contributor
0 Kudos

I think that will delete the replication entirely. Michal should use this code to access the column replications, and then find and edit the sub-replication relating to the data type

0 Kudos

Hello Phillip,

do you think that I can delete just one attribute from SourceReplication? This deletes whole replication of the column.

Thank you,

Michal Skoda

GeorgeMcGeachie
Active Contributor
0 Kudos

From a quick scan of the metamodel help, it looks like you can do this with a script, by accessing:

  • All Replications in the Model
  • For each Replication, access the SubReplications (these will be the columns)
  • For each SubReplication, access the SubReplications - one of these will represent the data type - set IsAttributeReplicated to False

Alternatively, access the list of tables in the model, and go directly to the replication properties.

You could also have a custom check that runs for each Column, checking the relevant SubReplication, with an AutoFix script to change it if it's wrong.

I hope I've interpreted the metamodel correctly!

0 Kudos

Hi George,

thank you for your answer and hint.

I got to this point but now I have no idea how to find the DataType attribute. Could you please help me?

Thank you,
Michal Skoda

set replications=ActiveModel.replications

for each rep in replications
   for each sub1 in rep.subreplications

   next
next