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.
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:
Enable Expert Mode.
Open Scripting Window.
Move your model from left side to right side using the Arrow buttons.
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:
Reply by Vaclav Frolik
Hi,
to change the value of Not for Replication checkbox for all relationships, do the following:
- Enable Expert Mode.
- Open Scripting Window.
- Move your model from left side to right side using the Arrow buttons.
- 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.