Toad World® Forums

Generating an alter script

When I use Model > Synchronize > Generate Change Script > Generate Alter Script against two similar data models (each model contains the same set of tables but some of the attributes are differenct), my TOAD version 5.2.4.25 always generates DROP + CREATE statements against the tables. This is unacceptable in our staged database environment, since the tables in several of the target environments contain production data. 1) Why is TOAD using DROP statements where it doesn’t need to? 2) How can I change this behavior?

Hello Bruce,

In your case there are several options:

  1. If you are worried about your production data, you might want to use Temporary Tables during Change Script generation. In TDM 5.2, the option is located in Settings Menu | Options | Physical Model | Your database platform (e.g. DB2). Check the Use Temporary Tables to Preserve Data checkbox and you’re good to go.

  2. If the previous method is unacceptable in your situation as well, we’re going to need some more information. What database platform and version are you using? What is the difference between attributes in the models, names, data types, something else? The change script generator takes all of these factors into account.

Regards,

Lukas

Thank you Lukas. Yes, the first option probably wouldn’t fly with our production deployment dept. I will try to gather up the information relevant to your second option. It sounds like you’re saying there may be a “under the radar” underlying difference that forces a drop/recreate?

On Thu, Nov 20, 2014 at 12:23 AM, Lukas Knapek bounce-LukasKnapek@toadworld.com wrote:

RE: Generating an alter script

Reply by Lukas Knapek
Hello Bruce,

In your case there are several options:

  1. If you are worried about your production data, you might want to use Temporary Tables during Change Script generation. In TDM 5.2, the option is located in Settings Menu | Options | Physical Model | Your database platform (e.g. DB2). Check the Use Temporary Tables to Preserve Data checkbox and you’re good to go.
  1. If the previous method is unacceptable in your situation as well, we’re going to need some more information. What database platform and version are you using? What is the difference between attributes in the models, names, data types, something else? The change script generator takes all of these factors into account.

Regards,

Lukas

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or Unsubscribe from Toad Data Modeler - General notifications altogether.

Toad Data Modeler - Discussion Forum

Flag this post as spam/abuse.

Yes, it seems that some differences force the drop/create statements in the resulting script while other differences may only need alter statement in the change script. If we can get more information, we might be able to think of a way to generate the change script with no drop statements at all.