Toad World® Forums

safeguard for sync script to run in the correct db


#1

They sync script has a blurp on where to execute the script to make it look like your source db. But I would like to see if you can generate sync script with the ability to check, alert and not to execute when user accidentally runs it in the wrong database.

Is this a possibility?
Thanks


#2

I’m not very clear about your request. Are you saying if you did a data compare with 2 databases and generated a sync script to make db A like db B, but you don’t want to accidently run it to make db B like db A? What database are you using? The first statement of the sync script will set the current schema, unless both of your databases have the same schema name, it won’t execute on both.
Otherwise, since the script does not contain server connection info, it will execute on any connection if the same schema and table exists. We have description comments at the beginning of the sync script to tell user which connection it should run against.