Generating a DDL script that can *actually* rebuild the database??

Hi All,

One of the main reasons I purchased TOAD for SQL Server was for its script generation capability. I need to generate SQL scripts that can rebuild the database in its entirety for our installation program.

However, I have discovered that when generating a DDL script that includes everything, including foreign keys, the tables are created in alphabetical order, which makes the script unusable since tables that the keys are dependent on may not have been created yet.

I had hoped to work around this by generating a DDL script that created everything except the foreign keys, and then another DDL script with just the foreign keys. However, I cannot find an option to generate the keys only – it always wants to create the tables!

Does anyone know if TOAD offers a way to create usable DDL scripts that includes being able to rebuild everything correctly, including foreign keys?

I have noticed the same thing. I like Toad but in this case I’ve found SSMS does a better job because it scripts all of the drops, then all of the tables and finally, all of the foreign keys. That way all of the dependencies are respected.

Hi All,

Try Generate DDL in latest version of Toad for Sql Server.

You can add/remove drops of objects to script.

Tables scripts in alphabetical order, but all foreign keys build after tables.

We worked hard on performance issues.
And more other intresting features we added for you