script to set NOT for replication

I’m looking for a script to set the NOT FOR REPLICATION attribute on my foreign keys in TDM.

The Model is setup as SQL 2008

Any help would be appreciated.

Hi,

to change the value of Not for Replication checkbox for all relationships, do the following:

  1. Enable Expert Mode.

  2. Open Scripting Window.

  3. Move your model from left side to right side using the Arrow buttons.

  4. Add the following script to the body and execute it.

Result:

Code:

function main()
{
var e, iterRelation;
for (e=0; e<Model.Relations.Count; e++)
{
iterRelation = Model.Relations.GetObject(e);
iterRelation.NotForReplication = true;
}
}

Regards,

Vaclav

Thanks!

On Thu, Aug 14, 2014 at 5:26 AM, Vaclav Frolik bounce-Vaclav_Frolik@toadworld.com wrote:

RE: script to set NOT for replication

Reply by Vaclav Frolik
Hi,

to change the value of Not for Replication checkbox for all relationships, do the following:

  1. Enable Expert Mode.
  1. Open Scripting Window.
  1. Move your model from left side to right side using the Arrow buttons.
  1. Add the following script to the body and execute it.

Result:

Code:

function main()
{
var e, iterRelation;

for (e=0; e<Model.Relations.Count; e++)
{
iterRelation = Model.Relations.GetObject(e);

iterRelation.NotForReplication = true;   
}

}

Regards,

Vaclav

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or Unsubscribe from Toad Data Modeler - Scripting & Customizations notifications altogether.

Toad Data Modeler - Scripting & Customizations Discussion Forum

Flag this post as spam/abuse.