Toad World® Forums

Strangeness in generate compare script wizard

Hello and Thanks for Reading
Made a ton of changes to the model, ran generate change script, applied it to the database, got errors (This is a first).

As I'm in design mode (no actual data yet) I took the database offline, deleted the data files, recreated the schema/file groups, ran generate DDL in Toad, ran it, no errors.

Then just to make sure I was in sync, I ran generate change script. To my surprise it generated a rather large script. So I ran it against the database. No errors.

Ran generate change script again. This time several tables were not selected in the first dialog. As I want to compare everything, I checked them. Again a large script.

I'm really not sure what's going on here. I suppose I could delete the model and reverse engineer the database but then my beautiful ERD diagram I spent hours making all the lines pretty would have to be done over.

I'm probably doing something stupid, any ideas?

Hello Alan,
if you generate a change script from the newly created model against the database there can be some differences due to some physical properties such as collation, file groups, etc. but there should not be any errors. Are you able to reproduce this problem? If yes, could you describe it to us or provide a sample for us?

The size of the generated change script is also affected by the options "Use temporary tables to preserves data". Run the change scrip wizard, go to the frame "DDL Code generation" and try to uncheck it.
There are some other options on the second frame "Comparison Settings" of the change script wizard you can try to check (Pair primary keys ..., Force comparison ..., Ignore schema ...).
You can also try to compare only the selected object. Go to the frame "Select object type", click Custom setting and choose e.g entities and relationships. Or click Detailed settings to display the list of all objects and select what do you want.
Instead of the reverse engineer of the whole database/schema, you can try to "Update model from database" (menu Model). It will rearrange only updated/newly added objects so you wouldn't have to lose all your work.

I hope some advice will be helpful to you.
Regards
Dave

Thanks Dave let me check that all the filegroups were created that might be the issue here.

Didn't think of that. Turning off temp tables to preserve data is also excellent advice.